Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp138938rdh; Wed, 22 Nov 2023 22:24:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEthfdTDCeiP+J2eew2BXfNBp0AsGluxxC6U2zp47RD1LXS7dHpxnht1Qvx81jCeFQfylWB X-Received: by 2002:a17:903:41cb:b0:1cc:5691:5113 with SMTP id u11-20020a17090341cb00b001cc56915113mr6068172ple.26.1700720639844; Wed, 22 Nov 2023 22:23:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700720639; cv=pass; d=google.com; s=arc-20160816; b=OxO5H6km6bH9BJ+ZHd8WGmL0+DwscVw2vkHBfuvxjEK2l0yYj2lhQD3GTH0GqPWTQR gRPMDMqWDWDBAlxJJM7FZAWW7YBUzs1z/oQo4WCeIhRsmWCkGCDGmXGYjenzSKtScI4x wyXuORjIYb3l0/ppwNa0GxL/LMyas+05Nh1JlQBVhnt/8V4Dhso6Lmtx84qB0fjtAuQ3 K1I0bxxxa9Er7RiOkX9zDYxpIE0B/XFwpxftfs1s0g8u9unFvb3moPS03ZcZj7mG4VST LoWUtAvmVNzUeyi8cUFDPSdCIiNaZzLd49eCOjkxYDYviO+gORHxSh1Kr9fj9IvZLgLl fsMw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature; bh=nMtiebIOUg6G5GVfKtOBT2VrSTwE8zT+dxC/gda5/8Y=; fh=JxdNtMhl9cFBIqYCzLIrAu5naAhiscSu8WwXhRPx+Kc=; b=ftBmlCkEsBRrDFBGrYFEwRn3tOYtQH64TVVVZGSLILGqdziqg70a+9ACuiBXRdAJJI Dv/nPj7BWIwA+Ngk4nzmjpGZRVr/9CtTmzj3pWnkdIpEcE50UcTWz7R6wuSXattbZTkk KSHFD2yZmWgiyPkMisavPaXLjw4At3JWq9ejQO9AqF1SWdR4BorY8I30gck5JBtgbkJi EFpB+s1+9k7NtqBl3KMJTBSKI+5f1xGWhkJdJjUs3D6Vq39VZxqC7tp3xkb3NzU4wkYu hJ65zzOVlHpDekw26BUNLKS5NnHIdeagAll47fSBtL0Sr6MwXUHL1CoXn825GlNYiRUz PUGA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=af6LoAGv; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id c4-20020a170902c1c400b001c589ba4a04si518105plc.24.2023.11.22.22.23.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 22:23:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=af6LoAGv; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9B91E807F49A; Wed, 22 Nov 2023 22:23:56 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344727AbjKWGXj (ORCPT + 99 others); Thu, 23 Nov 2023 01:23:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231504AbjKWGXi (ORCPT ); Thu, 23 Nov 2023 01:23:38 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E99D71B2; Wed, 22 Nov 2023 22:23:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UUYvyKUrgnBMbMka2uhk7aG3PsMqglcXwbAOs49Ap3/SREhn2XJt3yREu3RUAgfCZq9Yco5zRkhLklLnr7/lC1aSxq6T2PyBJ91uuPxJNa+L395CUXzzsxAaJTVR6cjJSVCeYRZaez36RFrd0AEPUCS9IlFQ17zhJ6kLyLA7trKSWzFukhm9YIJYSWK/nbuC6LJVyre032SscW8DilyFoCZJAlaCa9/gcEF1MLhZCTj+/xM18KdnHh7dTK6gNAwipj3edsNgJBYh3zMAu8NLcXiNS92nJXw3g8j4mgbX402glib0yLsZkbt9BJmtPc7qBR8RowSIQoDUrT+t2CZsyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nMtiebIOUg6G5GVfKtOBT2VrSTwE8zT+dxC/gda5/8Y=; b=BU0W9zOjg9nuzO2GzmbH0/lwhfWWA5g5ZiwT3xEiwYR4NJ6yYtSy0vldvQKt5AbZOi/xMtDAt2PrQRfBB/GRfjh8rpnOaOv3yAWmsOjWUoZYFCJ99YWaWC+1pIfNIgmuLHvWZn3SoIrGuT3Wi5uahyHzaAPsd68veFjCkGNJCJ5t81zI6VfSv6r/pQJrbnXH6bbNHzeH9ZcGFIwDjsGTY6SNpzhqTuZWVPEiJ94FKi2r68ZdfrKZBkCYgglgF9hv0AQLFKuCWf606IY9BiUYcR6NtLZCBblTa6t/bBm8Oi5IswVG4wpjcWSFxxz7HGHPui/HWwuPj8JGrrcmlDI1sA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nMtiebIOUg6G5GVfKtOBT2VrSTwE8zT+dxC/gda5/8Y=; b=af6LoAGvLLzdAPXnf+AKM27zZjBY12PLcL6hA2lRfq5XtANY6utUnc+S6YM9mfFNYRNa55Fp+sB7oEuGqXtbsgI+QsG2Rdyv9+9pgGEt4k6cupXW06YZyy6J5au8nShBq12363apdY+qFG1+Lb6HcD0iFEeQdlE3hvSsjHWuhPQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) by CO6PR12MB5459.namprd12.prod.outlook.com (2603:10b6:303:13b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.20; Thu, 23 Nov 2023 06:23:40 +0000 Received: from MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::83d7:9c4f:4d9b:1f2a]) by MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::83d7:9c4f:4d9b:1f2a%5]) with mapi id 15.20.7025.020; Thu, 23 Nov 2023 06:23:40 +0000 Message-ID: <1687d5aa-3c79-4bbf-ae4f-891208edab9b@amd.com> Date: Thu, 23 Nov 2023 00:23:36 -0600 User-Agent: Mozilla Thunderbird Subject: Re: [Patch v2] thunderbolt: Add quirk to reset downstream port To: Mika Westerberg , Sanath S Cc: Sanath S , andreas.noever@gmail.com, michael.jamet@intel.com, YehezkelShB@gmail.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20231122050639.19651-1-Sanath.S@amd.com> <20231122060316.GT1074920@black.fi.intel.com> <95ceae27-f88d-4915-870a-36cf9418f244@amd.com> <20231123060516.GB1074920@black.fi.intel.com> Content-Language: en-US From: Mario Limonciello In-Reply-To: <20231123060516.GB1074920@black.fi.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SN7PR04CA0094.namprd04.prod.outlook.com (2603:10b6:806:122::9) To MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR12MB6101:EE_|CO6PR12MB5459:EE_ X-MS-Office365-Filtering-Correlation-Id: a209ab72-93b2-4a3c-23e5-08dbebecbc04 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uuHsfXB4Xa0fccTZhoZbz+/N9wPq4ZngBU4/fbtWkiDusS7NEIkRRsfLrU3/nLaECYAMwM+SAukLxg0aG+Sw5HXJQb1OqkU7rbzqxvgudY0wmNJhX+tCAe5DbiKHVfmKl7nTPyMKVwD8s9zRDg5RwEjgJdSTe7Mjj25j9eektAM8dTeYMONyhuLkcmFiC8hVzrfkS04oukIxqtfJedgV58Hu7XYMmcOHyf/nHMqYsaTnEsb2ydTwiDCFtap8+tGlC3Rd4ihK3Rq0OZjz2V4pwhnskP0YwPxDXLjrMyQ0bZu6Lh7+sS2KmgW3w6CuFrQoCA6lkkUkybQ4FKiAa8ULPg2rzUQt0YLvQwMVG5/M4LnhMQNmpdUZXRbuupPsudTkeodnfT1hmmmwkuvKAIKwRxcseu07VXKt2boyBizMZug8sVT1r9UvKJWGrSlVLTTYGacN9cHv7tvPd0Q+VXbOHexY0DN0iV0KfrVbt7d/tExuXmBcBOaykTtnc/JCHkWwrb0LyQF18iu9tzZWBneKC/yfe0JPyAw2u7ijAWjdO3hv5wE83hdLZg6YG03gq0PgmSk1RzPZnFCnACPhJZ/f9euw6gbnMKYDWTmhl0NmoL2Wd8sKIZz7ow1hKdg+0PHIR0BJPm78RNbty4cv/sapGu9NnlBPK0v0ujFbrxXHUr6JGcCEuRapvHJfzvG18ZNt X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR12MB6101.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(346002)(376002)(136003)(366004)(396003)(230273577357003)(230922051799003)(230173577357003)(64100799003)(451199024)(186009)(1800799012)(110136005)(316002)(6636002)(66556008)(66476007)(66946007)(6512007)(53546011)(36756003)(6506007)(6666004)(26005)(2616005)(478600001)(31696002)(38100700002)(83380400001)(86362001)(6486002)(44832011)(2906002)(31686004)(5660300002)(8676002)(8936002)(41300700001)(4326008)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZmI3Ynd1SnduTzFkMFY3cVNRaldia0ZCZ2dkTm14dk4xUFNBbEhVQmt4Njlk?= =?utf-8?B?Nlk5SkhqNmhwOFRpQmJNMTM2VG0zMmR3WkF5Mm1ZWks0ZkdSdkg3V3JZbjdJ?= =?utf-8?B?eFk3L0orUnlTWkZKOFhVdDB5QWpIZGtjUmoxNFkzUVJUekwxOVpSb1lEYWdr?= =?utf-8?B?RFh3T2tHZFl4b1pkUHB0VHZJV3pJRTJMakc4bmtONklSUjJqVUZ6WS92Uk5j?= =?utf-8?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cXpRM0JxYVlxaUw0SUpodU9qckJNaGMzcDlleDJod3VZUkRV?= =?utf-8?B?YS9OT3BjT2dPcjJiQVJ5ZE1OM3lBWHdrazQzQ3YrT3hhTEE0TEF5TGtycmlT?= =?utf-8?Q?O3SlprQI6G1hbHSd7dTtAZzhn?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a209ab72-93b2-4a3c-23e5-08dbebecbc04 X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB6101.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2023 06:23:40.4243 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yiGBy/zFmExtZ5FdLjUurklIKvkeS7czW6+K+sTA/pNnIYK8hms94Jc4be3j+BEzBLvElBCIBaxtoJIUExhVmQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5459 X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 22 Nov 2023 22:23:56 -0800 (PST) On 11/23/2023 00:05, Mika Westerberg wrote: > On Thu, Nov 23, 2023 at 10:46:27AM +0530, Sanath S wrote: >> >> On 11/22/2023 9:13 PM, Mario Limonciello wrote: >>> On 11/22/2023 00:03, Mika Westerberg wrote: >>>> Hi, >>>> >>>> On Wed, Nov 22, 2023 at 10:36:39AM +0530, Sanath S wrote: >>>>> Boot firmware on AMD's Yellow Carp and Pink Sardine allocates >>>>> very minimal buses for PCIe downstream ports. This results in >>>>> failure to extend the daisy chain. >>>>> >>>>> Add quirk to reset the downstream port to help reset the topology >>>>> created by boot firmware. >>>> >>>> But this resets the USB4 side of ports, how does this help with the PCIe >>>> side? Or this also resets the PCIe side? Please add this information to >>>> the changelog too. >>> >> Sure, I'll add the PCIe side reset in changelog. >>> IIUC the PCIe side will be implicitly reset as well. >>> >>>> >>>> I suppose it is not possible to fix the boot firmware? >>> >>> It's a really difficult case to make with firmware team.  Windows and >>> Linux have a different behavior here.  The Windows CM doesn't take the >>> existing tunnels from firmware and instead always resets them. >>> So Windows "isn't affected" by this problem. >>> >>> Furthermore there are already lots of systems out "in the wild" as these >>> are already both production silicon with shipping OEM products. >>> >>>> >>>>> Suggested-by: Mario Limonciello >>>>> Signed-off-by: Sanath S >>>>> Fixes: e390909ac763 ("thunderbolt: Add vendor specific NHI quirk >>>>> for auto-clearing interrupt status") >>>>> Cc: >>>>> --- >>>>> Changes since v1: >>>>>   - Initialize ret variable to avoid compiler warning. >>>>>   - Add Fixes tag with commit id. >>>>> --- >>>>> >>>>>   drivers/thunderbolt/quirks.c  | 14 ++++++++++++++ >>>>>   drivers/thunderbolt/switch.c  | 28 ++++++++++++++++++++++++++++ >>>>>   drivers/thunderbolt/tb.h      |  2 ++ >>>>>   drivers/thunderbolt/tb_regs.h |  1 + >>>>>   4 files changed, 45 insertions(+) >>>>> >>>>> diff --git a/drivers/thunderbolt/quirks.c >>>>> b/drivers/thunderbolt/quirks.c >>>>> index e6bfa63b40ae..45e9d6c43e4a 100644 >>>>> --- a/drivers/thunderbolt/quirks.c >>>>> +++ b/drivers/thunderbolt/quirks.c >>>>> @@ -27,6 +27,12 @@ static void quirk_clx_disable(struct tb_switch *sw) >>>>>       tb_sw_dbg(sw, "disabling CL states\n"); >>>>>   } >>>>>   +static void quirk_amd_downstream_port_reset(struct tb_switch *sw) >>>>> +{ >>>>> +    sw->quirks |= QUIRK_DPR; >>>>> +    tb_sw_dbg(sw, "Resetting Down Stream Port\n"); >>>> >>>> That's "resetting downstream ports\n" >>>> >> Ack, Will take care in v3. >>>>> +} >>>>> + >>>>>   static void quirk_usb3_maximum_bandwidth(struct tb_switch *sw) >>>>>   { >>>>>       struct tb_port *port; >>>>> @@ -93,6 +99,14 @@ static const struct tb_quirk tb_quirks[] = { >>>>>       { 0x0438, 0x0209, 0x0000, 0x0000, quirk_clx_disable }, >>>>>       { 0x0438, 0x020a, 0x0000, 0x0000, quirk_clx_disable }, >>>>>       { 0x0438, 0x020b, 0x0000, 0x0000, quirk_clx_disable }, >>>>> +    /* >>>>> +     * Reset Down Stream Ports on AMD USB4 Yellow Carp and >>>>> +     * Pink Sardine platforms. >>>>> +     */ >>>>> +    { 0x0438, 0x0208, 0x0000, 0x0000, >>>>> quirk_amd_downstream_port_reset }, >>>>> +    { 0x0438, 0x0209, 0x0000, 0x0000, >>>>> quirk_amd_downstream_port_reset }, >>>>> +    { 0x0438, 0x020a, 0x0000, 0x0000, >>>>> quirk_amd_downstream_port_reset }, >>>>> +    { 0x0438, 0x020b, 0x0000, 0x0000, >>>>> quirk_amd_downstream_port_reset }, >>>>>   }; >>>>>     /** >>>>> diff --git a/drivers/thunderbolt/switch.c >>>>> b/drivers/thunderbolt/switch.c >>>>> index 1e15ffa79295..1c4b1dd5f472 100644 >>>>> --- a/drivers/thunderbolt/switch.c >>>>> +++ b/drivers/thunderbolt/switch.c >>>>> @@ -1547,6 +1547,23 @@ static void tb_dump_switch(const struct >>>>> tb *tb, const struct tb_switch *sw) >>>>>              regs->__unknown1, regs->__unknown4); >>>>>   } >>>>>   +static int tb_switch_reset_downstream_port(struct tb_switch *sw) >>>>> +{ >>>>> +    struct tb_port *port; >>>>> +    uint32_t val = 0; >>>> >>>> u32 >>>> >> Ack. >>>>> +    int ret = -1; >>>> >>>> What is -1? Please use proper error codes. >>>> >> Ack, It'll be ret = -ENODEV; >>>>> + >>>>> +    tb_switch_for_each_port(sw, port) { >>>>> +        if (port->config.type == TB_TYPE_PORT) { >>>> >>>> You mean >>>> >>>>     tb_port_is_null() >>>> >>>> also please make it a separate function, tb_port_reset() following the >>>> similar tb_port_unlock() and friends. With the matching kernel-doc and >>>> everything. >>>> >> Sure, I'll handle this and send a v3. >> Will also take case of 10ms delay as per spec. >>>>> +            val = val | PORT_CS_19_DPR; >>>>> +            ret = tb_port_write(port, &val, TB_CFG_PORT, >>>>> +                    port->cap_usb4 + PORT_CS_19, 1); >>>> >>>> Since it is using cap_usb4 you probably need to make usb4_port_reset() >>>> as well that gets called from tb_port_reset() (try to make it as simple >>>> as possible though). >>>> >>>>> +            break; >>>> >>>> It is OK just to reset one port? >>>> >> As per spec, setting the DPR bit of downstream port would help us >> reconfigure >> >> the USB4 link, So had a condition check only for downstream port. > > It can be used to re-configure the link but also simple reset. > > Actually can we instead of the quirk in quirks.c add this to nhi.c and > "host_reset". So that on these AMD controllers trigger host reset in the > same way Windows would? > > That's DPR and probably host interface reset. In other words tie this to > the host reset we are doing for USB4 v2 routers (this one adds it for > USB4 v1 routers and enables it by default for AMD). Assuming this "works" how would you feel about just "aligning the behavior" with Windows for all USB4 routers instead of just these AMD controllers and USB4v2?