From patchwork Thu Oct 27 13:31:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Lin X-Patchwork-Id: 13022164 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B26EFA3742 for ; Thu, 27 Oct 2022 13:31:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236113AbiJ0Nbw (ORCPT ); Thu, 27 Oct 2022 09:31:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236109AbiJ0Nbv (ORCPT ); Thu, 27 Oct 2022 09:31:51 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2081.outbound.protection.outlook.com [40.107.223.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78119172522; Thu, 27 Oct 2022 06:31:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W4Fi3bLRTqCgEkxjJ4CyOJglMO2ZUjZWBU2pWgSHMiLsobseMbdlIQVE4Hs8WBhBrO6h5mnjxg4pMdX3P3zMly5X9x8o5YtK/xc79YF8ONIy/DPcxfioayRH7sto3wiVBM6IrCugWjhHmQ9sOSl27yNpBul6rLBTaEwKTapK263KPqre7S93Ctwmmwukwx8Ys3/SVnxnnS74Rb2BcJ/ge6u+4yIZ7g4bc6SIHjeeoTk7uwd6QHV4tksBxp5Rwa2tUfAjwkvdkU1k1QvG4dIlQFR49IDiPULh0kiWG0Yf2r5eS82rwB/w4fX0D0a5H+OakDuMMKWQ9a3paqvenQPGxw== 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=SM/A0WIH/GzkFxF/q6myWG5gXkuSF77TryLzR39KYc8=; b=Pgjodz3W0ZxeSEO3B2dohD563u7LLxpg7/WfbjopN1fsCQj3MYHcZnd/YSa/od6H8SsEtJq7XtqpWiUXMZvk+Nbncn3NCieaKqPWZEvArDk9hs4MrktiIzDM7bJgjTtbHa3RRI5RRPdg9oedx/dUjtALSgHYfm8pGmsZoiOUXWTb7R25O0LnMO2J/4C33ZMD7J3qHdKbUx5wc3meHg0x2mxD4oJyj6GiRdHbgdI6hUuTOlQjehMN/YuDaNg52NTNiXn5yYTkh2tXeSnl9ZRDLTjPaUcYiLEgzf0IcHHiOQEI3WAFRt0hX94ZfLdumuQ7UToAzJOjAJHD9lcvfQhUBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SM/A0WIH/GzkFxF/q6myWG5gXkuSF77TryLzR39KYc8=; b=tWn7D4nD1+1XxHiOrfcC1qw1flHiZPgJMhIYypyjZwYpeJVg0eJG/aXjW1w9/nhR4s7j5ceaLreS7bkzp5wit6x0EqbgQOpcu5oW22NmSMJBT9i3+V//Dt9TB7rAP3rgEB1Gq7SRN1dzRO4lba732ZO5O7/Rt7UYlBuhC3QaXY1pj/LlH4+u2wGyesa3LFtICgBOGJbm4WpeBnBdcs47L6+Qrf3JVUBcH7PbiFZFMLSVJhyHvil9weIhQx20zb8LUq3UrIXBSsNd75/Yp+LMP6uXiv6kczQH6V7BVXgbR0EN4j5v7H5kS0kt5w8C97YFdYmp2WhbNmtI1cQgcXZRBQ== Received: from MW4PR04CA0098.namprd04.prod.outlook.com (2603:10b6:303:83::13) by DM4PR12MB6349.namprd12.prod.outlook.com (2603:10b6:8:a4::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.26; Thu, 27 Oct 2022 13:31:47 +0000 Received: from CO1NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:303:83:cafe::6a) by MW4PR04CA0098.outlook.office365.com (2603:10b6:303:83::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.29 via Frontend Transport; Thu, 27 Oct 2022 13:31:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT058.mail.protection.outlook.com (10.13.174.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.16 via Frontend Transport; Thu, 27 Oct 2022 13:31:47 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 27 Oct 2022 06:31:42 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Thu, 27 Oct 2022 06:31:41 -0700 Received: from jilin-desktop.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Thu, 27 Oct 2022 06:31:40 -0700 From: Jim Lin To: , , , CC: , , , Subject: [PATCH v5 1/3] xhci: hub: export symbol on xhci_hub_control Date: Thu, 27 Oct 2022 21:31:25 +0800 Message-ID: <20221027133127.27592-2-jilin@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221027133127.27592-1-jilin@nvidia.com> References: <20221027133127.27592-1-jilin@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT058:EE_|DM4PR12MB6349:EE_ X-MS-Office365-Filtering-Correlation-Id: 765c94f2-3284-4193-5d26-08dab81f98e3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xpbKV3721apDffIUrdhit8sUJImkzLIGteBIeHlilFSULjllklTpSQyaEwSGPPLrhxtxEWLYZ8rhTS23ozOW7piD4iufIjvl8/LMfhygCJGLytW6NQUVY7RX9EJYO5eEgZOAriwGR5/LB2pmp7fO0Pv4o99vR1JXfilA8JlGSbBYxqqPhMG2w+1dzrQcVZrG3dYIC1AudquI+14DkIQpgX11QHeSiWCHH4JgNOQfiI4mhnzBO7W6LayaxwoU+JhwaKt92fYKKoDthTh6OXz05ODDPhlOVe6BbwyCMdfUSl82p9szUGQrEXwvJEWI9mGM7UoDf28rnnZ//QvALx47Hi01rPiEjo4+NE9gmU8LObf8gIox0IoFutnlrqPH1MERRj1MUvbPpknv9022SPUDDW31J0dFhVV5weIscAH4qYIpszOS8/c6l2+LiuwmpkOL7tTItf9YaUh8Xf8LbTr+FB+LgoPVXsyH/yCIkW9F7iBdDLcWPZsHB1KC1nU+iPc3WAD4SC0fSVmy1TsoCXRr/PnyRLuR4kTbRtjNqObPCDWqLEECUwxM7VkMtKXbPvUkjZC6WFXaIdNsoo2gTzbMVVqj6GfmZleXONTRSSDIJ4vH4CIInr7sCpkvmAMHmRcHraDKvhAH69O+uJsO0P1aAH0omBxdNeDhc6jrLqBx9YnlpkBOPHfrhmzQbL2q4ChG7mQRwWcdOnIagToMsOtN1/BRRa1RWmlowcLhp5bPp8hmYQWOuWOwuSPbSJX4E0nwoiHQNv2Oox2n2nPY64Fajw== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(136003)(376002)(396003)(39860400002)(346002)(451199015)(36840700001)(46966006)(40470700004)(54906003)(86362001)(186003)(8676002)(83380400001)(26005)(47076005)(336012)(36860700001)(7636003)(426003)(2906002)(356005)(82740400003)(5660300002)(8936002)(1076003)(4744005)(107886003)(7696005)(70586007)(4326008)(82310400005)(41300700001)(2616005)(478600001)(40460700003)(40480700001)(70206006)(6636002)(316002)(110136005)(6666004)(36756003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2022 13:31:47.3943 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 765c94f2-3284-4193-5d26-08dab81f98e3 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6349 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add EXPORT_SYMBOL_GPL on xhci_hub_control() for other driver module to invoke and avoid linking error. Signed-off-by: Jim Lin --- v5: new change drivers/usb/host/xhci-hub.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index af946c42b6f0..4f20cdae2a89 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -1604,6 +1604,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, spin_unlock_irqrestore(&xhci->lock, flags); return retval; } +EXPORT_SYMBOL_GPL(xhci_hub_control); /* * Returns 0 if the status hasn't changed, or the number of bytes in buf. From patchwork Thu Oct 27 13:31:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Lin X-Patchwork-Id: 13022167 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE008FA3740 for ; Thu, 27 Oct 2022 13:33:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236165AbiJ0NdL (ORCPT ); Thu, 27 Oct 2022 09:33:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236150AbiJ0NdG (ORCPT ); Thu, 27 Oct 2022 09:33:06 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2089.outbound.protection.outlook.com [40.107.93.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B69171805B3; Thu, 27 Oct 2022 06:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZzRN8Nawmwcnb/yNM40BcvDTE5wnFyPYPI2NjI4NacL0Y2a0tS58zf4HEEBQ5DpLv3rOOx5FQ4abQa71rmLVFfyWSG86/19sWVTDc8rwWohV7WQxnxZYrOdMaIXuKDmASi4sKLXPxocE7yPVu/l46Vgb0Vo0KvCbI+ssvYdvQQDBrgEjrZJuM2goFHxK98SwgXLHIy9y7xVLn+Qzo78s1lII4sWxGO2V+0a74NwjXwPw2nolBShnLO+yfYtyeQtutAmwE15d/GFerHclpiJF7n2/t2BiFLaED+ErJcm9CP+ms2/TZG8zPwlEFFSCwPrPD4HRLqh1ommNbSbgwUquAw== 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=J0mLcsnN9bOL2ZI5/K14w7oV2ubzH+mMbLDegToQKXw=; b=ElgLXPYgxEQLwnxBu1OvAmVnu8yU1aRG42en2V8l0sQkpsrXu6yj89Ag1TcgxJWymd0ndwbRuHpnZpoMswYslGos+l0vYuYtexj5Pg8NFYe8dd8Jz+RhB8Mc7J2GNoTi9rV0Vmr8DdIpskEcndvkFHiXhtqOB8M41O9KvTrvnXX3WF80s/sS/B9kYee2ChgkPzmmXPsVaQw8Y1zeygSfZhorlddbvNj3pVHlrxtkOEAWUjV952zf+hS0gbKQH0gNukxJ3yIYIfYwcBECHYnpIvFEPH6ZskTDToj8eHJ2kYA3VZzeAwxH+fUlAVialKfw/V61mmYaa2zaWrzhkFJPyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=J0mLcsnN9bOL2ZI5/K14w7oV2ubzH+mMbLDegToQKXw=; b=jZzPZ7KWkF6jxeNPqHR6G+rQjrDhLP7rX6iTZLhs+1HKF3rnxvByjeIV5MBi54oRu9mt0j4LEeHldhDf24exLORmP2849U/7mWt3WjwFv5xim3unNXFq5VXMXsxvPE2lqnY6UoMFAyyb/WmjYXvni676D9nV7TFz8CoIuXWcqgrnSF96XpLE2z2Mu6QosNuZCKfpMvOxydSUJ18UcO/x1QUeevAbnZuAcx9JbfU/hdT+3hjHjZzBLlgGZHuzG/JYMjircEV1bGx47IR4oVbf09aGGMYR050sLD53bVRD+nN6WEWlgnrKSPBUxTg/uil8UpWzMMRo4qHD6NeSmTlmjA== Received: from MW4PR04CA0390.namprd04.prod.outlook.com (2603:10b6:303:81::35) by CY8PR12MB7491.namprd12.prod.outlook.com (2603:10b6:930:92::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28; Thu, 27 Oct 2022 13:31:51 +0000 Received: from CO1NAM11FT099.eop-nam11.prod.protection.outlook.com (2603:10b6:303:81:cafe::c0) by MW4PR04CA0390.outlook.office365.com (2603:10b6:303:81::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28 via Frontend Transport; Thu, 27 Oct 2022 13:31:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT099.mail.protection.outlook.com (10.13.175.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14 via Frontend Transport; Thu, 27 Oct 2022 13:31:51 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 27 Oct 2022 06:31:43 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Thu, 27 Oct 2022 06:31:43 -0700 Received: from jilin-desktop.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Thu, 27 Oct 2022 06:31:42 -0700 From: Jim Lin To: , , , CC: , , , Subject: [PATCH v5 2/3] xhci: Add hub_control to xhci_driver_overrides Date: Thu, 27 Oct 2022 21:31:26 +0800 Message-ID: <20221027133127.27592-3-jilin@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221027133127.27592-1-jilin@nvidia.com> References: <20221027133127.27592-1-jilin@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT099:EE_|CY8PR12MB7491:EE_ X-MS-Office365-Filtering-Correlation-Id: 6122a134-2d3f-4159-5561-08dab81f9b73 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mzdc/l6nMFZvuM9SArIRbbvf/3TXR9deq7x5E1zeEUGK1Ta5fWyex8RUIJ/1c5d5FyAVGPPfVEIvQkxJU6PrKW2bUXPW80Q/0xeJ0/Ksrh3oypXhsQeBUYcd0P4hvzvffDXqZKWoHp47ZaYDmcIo0/Uzgo2z92gIRX3gQNno5vEaJnBBw4wlq6wpCLpFYoVegnIJA1/WM/EcFYovr1puZ0T7zNfOflYWeApIuHfQr9ECWDy+QDKluMQ87Isb3X4WUWy8IKanuwS7q6aAymqVECfWEfcjbEquKvGIDwiaPysSKj5F038MlaZF7VkL2e0HLSzuEmDK9D4tmRbb1swWRZvP5/0+mcFb0UVsiP+cZCPvtxUe/XLX7ACHlYpz6uy2OgWtPZiuJDU6FM+edeHuzl3fbPQliCt7poSVr1mF4yDyqwvlaXYOfFD/Q5OyMgOAcE2JGC8Wx0sX6vuo6e6lKbEPdnaBd+Iu3tF9ohMIENfeAlxvbP9xeZHnr/9+9jmxk+564fFWUEdFOYhW2/YkyzKfVg3KkRmghzvC3HUHtUnPjKBWRjWMNr8OCamE3B0po9FgeAOuGSdM3k+QD+eJilcUPkPI918hkFp53+VFpH2uJ1GqyqVRROsLgU6I0AlwlyY5KfY7nOtpcoLWOtaCi1+MISMUzl3GrLdrOAOp6FY871eJykNUzfTKT5dDqEEe5kTg/7jpN3o2F7T1T8OkWoO5AoL8TcDb6FOKbu7GyS6TkZfPBOFRh5i/jqCeiQDbgvMc5pnx7t+83rivRyJIvg== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(376002)(136003)(39860400002)(396003)(346002)(451199015)(46966006)(40470700004)(36840700001)(2616005)(5660300002)(336012)(186003)(1076003)(2906002)(316002)(110136005)(70206006)(54906003)(26005)(40460700003)(41300700001)(8936002)(6636002)(7696005)(70586007)(4326008)(6666004)(107886003)(36756003)(8676002)(82740400003)(356005)(7636003)(36860700001)(426003)(40480700001)(47076005)(86362001)(82310400005)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2022 13:31:51.6776 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6122a134-2d3f-4159-5561-08dab81f9b73 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT099.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7491 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add hub_control to "struct xhci_driver_overrides". Add hub_control to xhci_init_driver() for platform xhci driver to override it for local feature. Signed-off-by: Jim Lin --- v5: new change drivers/usb/host/xhci.c | 2 ++ drivers/usb/host/xhci.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 902f410874e8..3c7bf0a0e0b4 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -5461,6 +5461,8 @@ void xhci_init_driver(struct hc_driver *drv, drv->check_bandwidth = over->check_bandwidth; if (over->reset_bandwidth) drv->reset_bandwidth = over->reset_bandwidth; + if (over->hub_control) + drv->hub_control = over->hub_control; } } EXPORT_SYMBOL_GPL(xhci_init_driver); diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 5a75fe563123..f5a17c75c144 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1943,6 +1943,8 @@ struct xhci_driver_overrides { struct usb_host_endpoint *ep); int (*check_bandwidth)(struct usb_hcd *, struct usb_device *); void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); + int (*hub_control)(struct usb_hcd *hcd, u16 typeReq, u16 wValue, + u16 wIndex, char *buf, u16 wLength); }; #define XHCI_CFC_DELAY 10 From patchwork Thu Oct 27 13:31:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Lin X-Patchwork-Id: 13022166 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2CADFA3745 for ; Thu, 27 Oct 2022 13:32:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236134AbiJ0NcD (ORCPT ); Thu, 27 Oct 2022 09:32:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236128AbiJ0NcC (ORCPT ); Thu, 27 Oct 2022 09:32:02 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2048.outbound.protection.outlook.com [40.107.220.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C7DB125034; Thu, 27 Oct 2022 06:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UMeSwA0S9sp9AFvyqgqiefXSx/wPN0yM0kCKZ2x+1TSNmrTKhUOMtOEB4F5c3c+oQWiXJbZcr79L0EDyzjqVA6HeWuZhUorjTE7M+G7mcf3oA1QKZYItgno8aFeooIsjfUdptZqsnqPgGjOxI0WPNJYLw5qKUN2TtqimzwhjtQkhLM4mPE5LHETtF5KSyzFL6wrmDLSsndDoqy7M4cpXMGW7kCeIoJ9b0iPa7/FicKsxa+317uTmyGMHgo4rA40ZLuhVYKxmUaIQNEc8iY2nN5UVlnnYLlK2h/+qTKp0eNYoE7lXT/vdY2furRngiohGH7sA63ttDGYEINLVE3ouiQ== 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=xaJvydLKwOFfBftUxYrwO82mJPPZXDYpli/nKld76Us=; b=boOdQueoKqi0rL9dzc46WgsxdMEXSPwk5vYs7DxD0/Sj577SzRuvCBWkS7Dtw5P8sMmcvMdUOtqO75cU/Mcbn5Mc4feOOEsnawEhCqS+Txo1xCHdQqfDRb2LvH7HAu+7EZS3LiAkHx5UyZJmdnRLpJC7VsgyblR+7DmCdYqEnznvQLzFHXpXEvLTE+MDVxgth5PgdL8Bk4mjWkDBjqDBpfjIlsoczEOyfwNMKcDeBEpznHfRyvCp0GGWGiJdTPYicjtZbdrsTCeJ/jZIGVrz1es7vLAyVMb0qSkJhWqDrV0vWpllXw23LkexNgSVKtQJ7p2FXugtD40qd49gh8ayKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xaJvydLKwOFfBftUxYrwO82mJPPZXDYpli/nKld76Us=; b=BrITjSVMZBvpQjtjoo2WNfcSKlBpWmcYctUKUBA5HroqyLN93DsiP6hJQfwqr5vKk6l+yW3YhHFnA60T9bvPL1zXNKNkVc85vEK7KWy5eHuP+LNmH4zFHcq0eXjShLum8Lx0//4yP6rEvWUUCs/nQ7WVdV614C+fZvFO36WAR7XuqZa18mJ9+E+3w0dkG4U0jWsWFb/5X0GBxpg9Q5+dGMDqhkje0s+jfaM0w7425UWuGukVyeWVTo++RMqc2jFIqvfM6T8B3yZNE/PZ7kC68EJAkkjZBFqswm60J6fNNRBJrhi2D6XrsnIiBXZD/RcBpIRjlzC7xwkoS8NbgC/ifg== Received: from DM6PR11CA0024.namprd11.prod.outlook.com (2603:10b6:5:190::37) by CH0PR12MB5137.namprd12.prod.outlook.com (2603:10b6:610:bc::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.25; Thu, 27 Oct 2022 13:31:59 +0000 Received: from DM6NAM11FT010.eop-nam11.prod.protection.outlook.com (2603:10b6:5:190::4) by DM6PR11CA0024.outlook.office365.com (2603:10b6:5:190::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.29 via Frontend Transport; Thu, 27 Oct 2022 13:31:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT010.mail.protection.outlook.com (10.13.172.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14 via Frontend Transport; Thu, 27 Oct 2022 13:31:59 +0000 Received: from rnnvmail203.nvidia.com (10.129.68.9) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 27 Oct 2022 06:31:46 -0700 Received: from rnnvmail203.nvidia.com (10.129.68.9) by rnnvmail203.nvidia.com (10.129.68.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Thu, 27 Oct 2022 06:31:45 -0700 Received: from jilin-desktop.nvidia.com (10.127.8.14) by mail.nvidia.com (10.129.68.9) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Thu, 27 Oct 2022 06:31:43 -0700 From: Jim Lin To: , , , CC: , , , , Petlozu Pravareshwar , JC Kuo Subject: [PATCH v5 3/3] xhci: tegra: USB2 pad power controls Date: Thu, 27 Oct 2022 21:31:27 +0800 Message-ID: <20221027133127.27592-4-jilin@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221027133127.27592-1-jilin@nvidia.com> References: <20221027133127.27592-1-jilin@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT010:EE_|CH0PR12MB5137:EE_ X-MS-Office365-Filtering-Correlation-Id: c4cdfea5-1ade-4698-93d3-08dab81fa019 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8r2oOu+4G21yPk2Rjat6Wqrgns8diWxwQTXjU+8yyERcbZAMGSaxDxS8EkHJlX7NjEJLKw8bax3J41PK4k+4qdGDnU+mOS+tFNZnV4agY24vxTcv7WmmxScCQU32bYxJi1n6IAvlSlJi9pCWG75hPr8F6dXExKYvIhkBsMlcaK/5ecpKsXFIDis2mE0cxLsDe20IugcaQnjaioebmpY9mc4ydd5NoLy0D/0+HRax9KvOyFrZaUex+yqjGwC9sMax/EgTZBTbK9E8z2/3Hh9oOhjYNtx5iOW0XRw1csWpGCMEbOtLhy+WHMJodNlyHwO+WFlAhW0RpKcLhOjqinP7ptYtpMObqlXMvAyZzed95z8exld05iG458aYdbxcFt7ijubw+wjfhNfKzdiKmIvJPjKe6P7fGRebWrFpJWy+Tg5fu8jeoI0JNs1aBCHnQA//un1HFYpYUvbvkRI8mY2ITZyl/l8IDAG1IupcU9BcqhAaXydfLioKA/XJMLYhhkm2eU6OH4JNGLOM/+D0hjxi0VU4eJnz8usUwZluz9UTPGz3lW/9fws1RZfYgz+Wfy5MeCGyLatGXYQEDV9krvUd2k6mxgsnue/b3Q3TsnA9XBmDx71QExAEYDN789IcT3w5UBQ7gA7ZhNxwQ9MwmW1hDF0wYZi4puSJg6SN6SFG4cFSesgTPbBnvB8Vy3rnMlPbsFt3HPwj4F+Zb8/mO1Z3boA9HsP1GfvivPF4MKiFfuGDEYUlYYnDIdEnxJn5ar0h3GvediFciLGRqoZzqR23Kw== X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(136003)(396003)(376002)(346002)(451199015)(40470700004)(46966006)(36840700001)(356005)(7636003)(8676002)(82740400003)(40460700003)(107886003)(40480700001)(8936002)(36860700001)(36756003)(5660300002)(2906002)(82310400005)(426003)(70206006)(70586007)(47076005)(336012)(186003)(4326008)(6666004)(83380400001)(41300700001)(86362001)(110136005)(6636002)(54906003)(2616005)(478600001)(1076003)(26005)(7696005)(316002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Oct 2022 13:31:59.4311 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c4cdfea5-1ade-4698-93d3-08dab81fa019 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT010.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5137 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Program USB2 pad PD controls during port connect/disconnect, port suspend/resume, and test mode, to reduce power consumption on disconnect or suspend. Signed-off-by: Petlozu Pravareshwar Signed-off-by: JC Kuo Signed-off-by: Jim Lin Signed-off-by: lines should also be in chronological order, so So if --- v2: Fix issue that wrong tegra->phys[] may be accessed on tegra124 v3: No change on copyright v4: Remove hcd_to_tegra_xusb() function which is used only once. v5: Update .hub_control in tegra_xhci_overrides (xhci-tegra.c) Invoke xhci_hub_control() directly (xhci-tegra.c) drivers/usb/host/xhci-tegra.c | 131 +++++++++++++++++++++++++++++++++- 1 file changed, 130 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c index c8af2cd2216d..f685bb7459ba 100644 --- a/drivers/usb/host/xhci-tegra.c +++ b/drivers/usb/host/xhci-tegra.c @@ -189,6 +189,13 @@ struct tegra_xusb_context_soc { } fpci; }; +enum tegra_xhci_phy_type { + USB3_PHY, + USB2_PHY, + HSIC_PHY, + MAX_PHY_TYPES, +}; + struct tegra_xusb_soc { const char *firmware; const char * const *supply_names; @@ -274,6 +281,7 @@ struct tegra_xusb { bool suspended; struct tegra_xusb_context context; + u32 enable_utmi_pad_after_lp0_exit; }; static struct hc_driver __read_mostly tegra_xhci_hc_driver; @@ -1949,12 +1957,30 @@ static void tegra_xhci_enable_phy_sleepwalk_wake(struct tegra_xusb *tegra) static void tegra_xhci_disable_phy_wake(struct tegra_xusb *tegra) { struct tegra_xusb_padctl *padctl = tegra->padctl; - unsigned int i; + unsigned int i, j; for (i = 0; i < tegra->num_phys; i++) { if (!tegra->phys[i]) continue; + if (tegra_xusb_padctl_remote_wake_detected(padctl, tegra->phys[i])) { + if (i < tegra->soc->phy_types[USB3_PHY].num) { + /* USB3 */ + j = i; + } else if (i < (tegra->soc->phy_types[USB3_PHY].num + + tegra->soc->phy_types[USB2_PHY].num)) { + /* USB2 */ + j = i - tegra->soc->phy_types[USB3_PHY].num; + tegra_phy_xusb_utmi_pad_power_on(tegra->phys[i]); + } else { + /* HSIC */ + j = i - (tegra->soc->phy_types[USB3_PHY].num + + tegra->soc->phy_types[USB2_PHY].num); + } + dev_dbg(tegra->dev, + "%s port %u (0 based) remote wake detected\n", + dev_name(&tegra->phys[i]->dev), j); + } tegra_xusb_padctl_disable_phy_wake(padctl, tegra->phys[i]); } } @@ -1972,6 +1998,23 @@ static void tegra_xhci_disable_phy_sleepwalk(struct tegra_xusb *tegra) } } +static void tegra_xhci_program_utmi_power_lp0_exit(struct tegra_xusb *tegra) +{ + unsigned int i; + + for (i = 0; i < tegra->soc->phy_types[USB2_PHY].num; i++) { + if (!is_host_mode_phy(tegra, USB2_PHY, i)) + continue; + /* USB2 */ + if (tegra->enable_utmi_pad_after_lp0_exit & BIT(i)) + tegra_phy_xusb_utmi_pad_power_on( + tegra->phys[tegra->soc->phy_types[USB3_PHY].num + i]); + else + tegra_phy_xusb_utmi_pad_power_down( + tegra->phys[tegra->soc->phy_types[USB3_PHY].num + i]); + } +} + static int tegra_xusb_enter_elpg(struct tegra_xusb *tegra, bool runtime) { struct xhci_hcd *xhci = hcd_to_xhci(tegra->hcd); @@ -1980,6 +2023,7 @@ static int tegra_xusb_enter_elpg(struct tegra_xusb *tegra, bool runtime) unsigned int i; int err; u32 usbcmd; + u32 portsc; dev_dbg(dev, "entering ELPG\n"); @@ -1993,6 +2037,15 @@ static int tegra_xusb_enter_elpg(struct tegra_xusb *tegra, bool runtime) goto out; } + for (i = 0; i < tegra->soc->phy_types[USB2_PHY].num; i++) { + if (!xhci->usb2_rhub.ports[i]) + continue; + portsc = readl(xhci->usb2_rhub.ports[i]->addr); + tegra->enable_utmi_pad_after_lp0_exit &= ~BIT(i); + if (((portsc & PORT_PLS_MASK) == XDEV_U3) || ((portsc & DEV_SPEED_MASK) == XDEV_FS)) + tegra->enable_utmi_pad_after_lp0_exit |= BIT(i); + } + err = xhci_suspend(xhci, wakeup); if (err < 0) { dev_err(tegra->dev, "failed to suspend XHCI: %d\n", err); @@ -2066,6 +2119,8 @@ static int tegra_xusb_exit_elpg(struct tegra_xusb *tegra, bool runtime) phy_power_on(tegra->phys[i]); } + if (tegra->suspended) + tegra_xhci_program_utmi_power_lp0_exit(tegra); tegra_xusb_config(tegra); tegra_xusb_restore_context(tegra); @@ -2437,8 +2492,82 @@ static int tegra_xhci_setup(struct usb_hcd *hcd) return xhci_gen_setup(hcd, tegra_xhci_quirks); } +static int tegra_xhci_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index, + char *buf, u16 length) +{ + struct tegra_xusb *tegra = dev_get_drvdata(hcd->self.controller); + struct xhci_hcd *xhci = hcd_to_xhci(hcd); + struct xhci_hub *rhub; + struct xhci_bus_state *bus_state; + int port = (index & 0xff) - 1; + int i; + struct xhci_port **ports; + u32 portsc; + int ret; + + rhub = &xhci->usb2_rhub; + bus_state = &rhub->bus_state; + if (bus_state->resuming_ports && hcd->speed == HCD_USB2) { + ports = rhub->ports; + i = rhub->num_ports; + while (i--) { + if (!test_bit(i, &bus_state->resuming_ports)) + continue; + portsc = readl(ports[i]->addr); + if ((portsc & PORT_PLS_MASK) == XDEV_RESUME) + tegra_phy_xusb_utmi_pad_power_on( + tegra->phys[tegra->soc->phy_types[USB3_PHY].num + i]); + } + } + + if (hcd->speed == HCD_USB2) { + i = tegra->soc->phy_types[USB3_PHY].num + port; + if ((type_req == ClearPortFeature) && (value == USB_PORT_FEAT_SUSPEND)) { + if (!index || index > rhub->num_ports) + return -EPIPE; + tegra_phy_xusb_utmi_pad_power_on(tegra->phys[i]); + } + if ((type_req == SetPortFeature) && (value == USB_PORT_FEAT_RESET)) { + if (!index || index > rhub->num_ports) + return -EPIPE; + ports = rhub->ports; + portsc = readl(ports[port]->addr); + if (portsc & PORT_CONNECT) + tegra_phy_xusb_utmi_pad_power_on(tegra->phys[i]); + } + } + + ret = xhci_hub_control(hcd, type_req, value, index, buf, length); + if (ret < 0) + return ret; + + if (hcd->speed == HCD_USB2) { + if ((type_req == SetPortFeature) && (value == USB_PORT_FEAT_SUSPEND)) + /* We don't suspend the PAD while HNP role swap happens on the OTG port */ + if (!((hcd->self.otg_port == (port + 1)) && hcd->self.b_hnp_enable)) + tegra_phy_xusb_utmi_pad_power_down(tegra->phys[i]); + + if ((type_req == ClearPortFeature) && (value == USB_PORT_FEAT_C_CONNECTION)) { + ports = rhub->ports; + portsc = readl(ports[port]->addr); + if (!(portsc & PORT_CONNECT)) { + /* We don't suspend the PAD while HNP role swap happens on the OTG + * port + */ + if (!((hcd->self.otg_port == (port + 1)) && hcd->self.b_hnp_enable)) + tegra_phy_xusb_utmi_pad_power_down(tegra->phys[i]); + } + } + if ((type_req == SetPortFeature) && (value == USB_PORT_FEAT_TEST)) + tegra_phy_xusb_utmi_pad_power_on(tegra->phys[i]); + } + + return ret; +} + static const struct xhci_driver_overrides tegra_xhci_overrides __initconst = { .reset = tegra_xhci_setup, + .hub_control = tegra_xhci_hub_control, }; static int __init tegra_xusb_init(void)