From patchwork Thu Aug 13 03:37:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 11711629 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C6E3618 for ; Thu, 13 Aug 2020 03:38:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 045AC207F7 for ; Thu, 13 Aug 2020 03:38:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Czq38EKX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726578AbgHMDit (ORCPT ); Wed, 12 Aug 2020 23:38:49 -0400 Received: from mail-vi1eur05on2040.outbound.protection.outlook.com ([40.107.21.40]:46849 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726567AbgHMDis (ORCPT ); Wed, 12 Aug 2020 23:38:48 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JAYBsxancNQwsspbuLW+XKgmaZthBqi/WZHGFYhQLyvwNPR2piskmZ7OH7pQkjbVKoieJoHfweod0fZqbplnDmYz4M8tv2BKejnLL02bcxhuld1TtIU+TDyKxEDUzA84AD6O8Hc9NTsSWtFwBh9KbHQmDstJNQ6j5/mwc0sWSPqk4cgtqkwgd3y0fj5kil8+hFfhbEkKj0x5agf5bSsBRfa0e2GFWGhf3saxGwAfNfBlPw4tErR4tyVWc0gSv5pVISZGgSRwwyCj08Mnfn4SV4APfO3angDqR29ItRoljPK0Rc3/S6Xw68WI8/ZK5jnsR/DLWm/YNbMn85xJ3+TL+w== 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-SenderADCheck; bh=a21MYJG585ovaQvFo1R1pG9GmwyxlzAKPyrUzmHcoPc=; b=Vy6ngt6S3E0yARGO2VU9AG8vo/fM6fuTT8JbtuOisJtTzeZVeBTIFIWbZFuz522g3CtPSjXJ+TrM5sGUmw/fHM0Vya4PEjKceAgsM/Ovk4GvyeH0H1CKKKccfmNOuo8swuVN0TV7VAQprP9enlG+fXb5tduhFepIoF/LiOKQEGgvS81Dk+Kiiv9AdUNtWT10mH1EpY5F1zP9ItXg6X8rAMyxBeHkTC02a8wvgqwKWJlv1cmQkmuKVDHYys9YoAAYVPDJFQr4GT7t6nrWqi2/cDT7/v3r9eMpphcleOzVi+hL8A1l0JDR8oqfVwIE0vj385ReK8iJKgs7MBjgbCq7KA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=a21MYJG585ovaQvFo1R1pG9GmwyxlzAKPyrUzmHcoPc=; b=Czq38EKXKThJjfPLgSRStfjlR35Q4jM9mQqKO1+8pCugAPGYkQ6O4mq94fSsVD3ljNu/TIVClaDhVJ78Qbi9GBumhDMN4G2RFJcUFWUiV0OKwewHOOzAFp6k14hhDpZjBhkhbuCcJDcANQOfV5El+miDkOL5q3w6To5zrDS57SY= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) by AM6PR0402MB3654.eurprd04.prod.outlook.com (2603:10a6:209:21::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16; Thu, 13 Aug 2020 03:38:45 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::ed7f:8755:5994:7fcf]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::ed7f:8755:5994:7fcf%5]) with mapi id 15.20.3261.025; Thu, 13 Aug 2020 03:38:45 +0000 From: Peter Chen To: mathias.nyman@intel.com Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, linux-imx@nxp.com, Peter Chen Subject: [RESEND PATCH 1/7] usb: host: xhci-plat: add platform data support Date: Thu, 13 Aug 2020 11:37:35 +0800 Message-Id: <20200813033741.13982-2-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200813033741.13982-1-peter.chen@nxp.com> References: <20200813033741.13982-1-peter.chen@nxp.com> X-ClientProxiedBy: SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) To AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from b29397-desktop.ap.freescale.net (119.31.174.67) by SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.15 via Frontend Transport; Thu, 13 Aug 2020 03:38:43 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3ca2b06d-0666-4f8c-1814-08d83f3a6187 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3654: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1091; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7157.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(396003)(376002)(136003)(346002)(39860400002)(6506007)(478600001)(316002)(26005)(6666004)(36756003)(6486002)(86362001)(186003)(6512007)(2906002)(66946007)(6916009)(66476007)(66556008)(4326008)(5660300002)(956004)(2616005)(16526019)(8936002)(8676002)(52116002)(1076003)(44832011)(83380400001);DIR:OUT;SFP:1101; X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ca2b06d-0666-4f8c-1814-08d83f3a6187 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7157.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2020 03:38:45.2818 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hhX49RK8s1cPOx+yRY3S9cOC2Q0Be4WGPz7PLsUC97s1NmouJ18XW46Lri+4D+aK+5z2u8juvxXpLmekNV9dbQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3654 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Some xhci hosts (eg dwc3 and cdns3) do not use OF to create platform device, they create xhci-plat platform device runtime. And these platforms may also have quirks, and the quirks could be supplied by their parent device through platform data. Reviewed-by: Jun Li Acked-by: Mathias Nyman Signed-off-by: Peter Chen --- drivers/usb/host/xhci-plat.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 3057cfc76d6a..c7f98edc5678 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -264,7 +264,11 @@ static int xhci_plat_probe(struct platform_device *pdev) if (ret) goto disable_reg_clk; - priv_match = of_device_get_match_data(&pdev->dev); + if (pdev->dev.of_node) + priv_match = of_device_get_match_data(&pdev->dev); + else + priv_match = dev_get_platdata(&pdev->dev); + if (priv_match) { struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); From patchwork Thu Aug 13 03:37:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 11711631 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E3CA11392 for ; Thu, 13 Aug 2020 03:38:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CBF0C206A4 for ; Thu, 13 Aug 2020 03:38:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="O5BsyDq1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726587AbgHMDiv (ORCPT ); Wed, 12 Aug 2020 23:38:51 -0400 Received: from mail-vi1eur05on2040.outbound.protection.outlook.com ([40.107.21.40]:46849 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726576AbgHMDiu (ORCPT ); Wed, 12 Aug 2020 23:38:50 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D7d6pQbAjMh0lRKMuztLOZ//zWaRUs7nA/RQmx8ZEVJBr0uj9ZXXVkPqaOJeZaca1cMT0JAls1tjll+rJJRta5c/M2CcJ4L/cFIY2sgGjRKK6PEg1eCA/6tiUd2owvq52zka5KKh/AT9qAHImGmM011X+LZSmCItRlFc+RXXwSZqC8PbjrXVzSzyUoeTVHJFMTn5ugS05/JeNJkNcObLZkzjtNDGTxEyX7wUbeqFYJ9vcsBToLbpnd2UZZzxqttXbt4df8K/yGqQSEngHFwrfS0iY0aTr2oZr8vQTwNsdAYUBA0ZsLfzHTkq+NPMI93epXAZeSEX7G84VyrpnC/LKw== 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-SenderADCheck; bh=spaYOvH8F/9QH7WGZtpWwXsHPxLiYcpIsu4YuOb9WE4=; b=XFQH3lKlp+sYp99tGC6B4BvUhx/ksbmdiHjl7V/hKgxAo2JJnydSkF2daBMolFtXek8kwfokjb3FsHxR2dFtiya5ckeCLfDLPYEwnbLDFR+PHCM5qUlX5L4Zl7rS8Dv6CyotMwvsWVzhjiL2aAvKXYyRkwDXMZ9m19bEw2HfUttXwaXcmi2tLwASECcFx3vOPfWWcNFvyfpY3ZeUZm3Um+JZ7dg0bqriaQox7TredrXMJkNgjpnGyao7TXv54xE9qQZ5Tru6aP3xfLckB52YAXX3k/EL8EKSrSwQYQOcFyyn2Hm+SYNw0kSjEfOElWwHQWlOdp+bmgSDBU2HAePrvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=spaYOvH8F/9QH7WGZtpWwXsHPxLiYcpIsu4YuOb9WE4=; b=O5BsyDq14SYp6rcTnAwgfsIwjUEYIv4s5ukIssAhnp0UyEaW07RT2r9mGimq0uOZ/KOwUnhp6aGHh7IrqsNNMjyg+fWU2nWBnXUM+VYMY+T2N3RpskQQ5duAxHtVgSqVxR6NWeBeq/VbAS3rGFZgfxRdHzCetnNgTTUcbi2IgBQ= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) by AM6PR0402MB3654.eurprd04.prod.outlook.com (2603:10a6:209:21::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16; Thu, 13 Aug 2020 03:38:47 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::ed7f:8755:5994:7fcf]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::ed7f:8755:5994:7fcf%5]) with mapi id 15.20.3261.025; Thu, 13 Aug 2020 03:38:47 +0000 From: Peter Chen To: mathias.nyman@intel.com Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, linux-imx@nxp.com, Peter Chen Subject: [RESEND PATCH 2/7] usb: host: xhci-plat: add .suspend_quirk for struct xhci_plat_priv Date: Thu, 13 Aug 2020 11:37:36 +0800 Message-Id: <20200813033741.13982-3-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200813033741.13982-1-peter.chen@nxp.com> References: <20200813033741.13982-1-peter.chen@nxp.com> X-ClientProxiedBy: SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) To AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from b29397-desktop.ap.freescale.net (119.31.174.67) by SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.15 via Frontend Transport; Thu, 13 Aug 2020 03:38:45 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 53a122be-a401-47e9-6cee-08d83f3a62d9 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3654: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7157.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(396003)(376002)(136003)(346002)(39860400002)(6506007)(478600001)(316002)(26005)(6666004)(36756003)(6486002)(86362001)(186003)(15650500001)(6512007)(2906002)(66946007)(6916009)(66476007)(66556008)(4326008)(5660300002)(956004)(2616005)(16526019)(8936002)(8676002)(52116002)(1076003)(44832011)(83380400001)(142923001);DIR:OUT;SFP:1101; X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53a122be-a401-47e9-6cee-08d83f3a62d9 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7157.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2020 03:38:47.3527 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EOAZUEIMam31GfLypPddqbcQhg4UqLbOTd2D5w5Vu4GEJ2dlRIte1oAOlI1Ea6/tSu0mz4nQVGgtBN1RUJflaQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3654 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Some platforms (eg cdns3) may have special sequences between xhci_bus_suspend and xhci_suspend, add .suspend_quick for it. Reviewed-by: Jun Li Acked-by: Mathias Nyman Signed-off-by: Peter Chen --- drivers/usb/host/xhci-plat.c | 19 +++++++++++++++++++ drivers/usb/host/xhci-plat.h | 1 + 2 files changed, 20 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index c7f98edc5678..c3ce4d762adf 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -54,6 +54,16 @@ static int xhci_priv_init_quirk(struct usb_hcd *hcd) return priv->init_quirk(hcd); } +static int xhci_priv_suspend_quirk(struct usb_hcd *hcd) +{ + struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); + + if (!priv->suspend_quirk) + return 0; + + return priv->suspend_quirk(hcd); +} + static int xhci_priv_resume_quirk(struct usb_hcd *hcd) { struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); @@ -401,7 +411,11 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct xhci_hcd *xhci = hcd_to_xhci(hcd); + int ret; + ret = xhci_priv_suspend_quirk(hcd); + if (ret) + return ret; /* * xhci_suspend() needs `do_wakeup` to know whether host is allowed * to do wakeup during suspend. Since xhci_plat_suspend is currently @@ -438,6 +452,11 @@ static int __maybe_unused xhci_plat_runtime_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct xhci_hcd *xhci = hcd_to_xhci(hcd); + int ret; + + ret = xhci_priv_suspend_quirk(hcd); + if (ret) + return ret; return xhci_suspend(xhci, true); } diff --git a/drivers/usb/host/xhci-plat.h b/drivers/usb/host/xhci-plat.h index b49f6447bd3a..1fb149d1fbce 100644 --- a/drivers/usb/host/xhci-plat.h +++ b/drivers/usb/host/xhci-plat.h @@ -15,6 +15,7 @@ struct xhci_plat_priv { unsigned long long quirks; void (*plat_start)(struct usb_hcd *); int (*init_quirk)(struct usb_hcd *); + int (*suspend_quirk)(struct usb_hcd *); int (*resume_quirk)(struct usb_hcd *); }; From patchwork Thu Aug 13 03:37:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 11711633 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F47E1392 for ; Thu, 13 Aug 2020 03:38:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67CBE207F7 for ; Thu, 13 Aug 2020 03:38:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="eBnX2Hbz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726605AbgHMDiw (ORCPT ); Wed, 12 Aug 2020 23:38:52 -0400 Received: from mail-vi1eur05on2040.outbound.protection.outlook.com ([40.107.21.40]:46849 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726567AbgHMDiw (ORCPT ); Wed, 12 Aug 2020 23:38:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RbwXhUJdz19wJUAalew5vXEHI0g98W3L1KwOJ9/Erx1GkpR+93/R7wQd205aRsrl0S2nS6LZ1reneC6HqBEAtwPQ5m36bi6ixFTjSqLk13fNxROqeaBJnfW5lIxYOlpXnIFIbSpJK5KL086fG23Soh9JI2JnVvTZDz7bT9dl6ZLmfcNmGEnnsEnFJPBsjz4QB2hrWnY53sPxL/EAUkUPLn1hqNxkto2/pLaNlUXZwsaRNNLua+ummJ1Pf370EGinDwdpbj/y4QAsNvjWp+twLNB+V7XkCijO+ASrp9q7udgpjtgZqG4x0PARlcDLg9ktXQEbWuEVzp8td60JDnNr+A== 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-SenderADCheck; bh=ZfrFUDPb69L8vfOARLboHH2xUrGOUv0v6vlI3f5Ffdk=; b=Tj7PgFszcySISYYuBkuMpP6gZHFyhlziMjdMpjHbV+aPQ6B3Reau0MR+pqD6LJL57V3oompBNAX2qu6IkK5GKZrPJCoLVQoDHNVC5l+cV/UDn7B0odcaMX4Xn0TVUTem4KE2mDA3PYNC+Ql4NgYEytH9VdRvG60TNs3PaW+uKNjGAa0LmzsnLA4IESNFB9Bxwh1hbM1dQJVlVOOFmcci6w8OligDmkxejmr2yloOMoR+5UukkSjkr6CGE6CModQggkvwwnEnXWYpVZf81JbJrJM8bAPQFjQPHln2GjCNRF3rcCiFVK4vbt0lS1vSEJ2n4nUF4x2mnU282oycm4yK/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZfrFUDPb69L8vfOARLboHH2xUrGOUv0v6vlI3f5Ffdk=; b=eBnX2HbzN1Ua0PYbOJJbW3l+I+JbG92h4QIoIC0mY/Csxn4l3dvX8cezT5YvNhx9Mix1qZo9EmizKoot7bJPfCv8bA8j5BjGZHBvb4FhcQBqCKfqy7Kt2oMOcin1ntQNKHLgADYWXX7b9aLaZzHaThQ03X8gwPXUNQKHLxngUEU= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) by AM6PR0402MB3654.eurprd04.prod.outlook.com (2603:10a6:209:21::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16; Thu, 13 Aug 2020 03:38:49 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::ed7f:8755:5994:7fcf]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::ed7f:8755:5994:7fcf%5]) with mapi id 15.20.3261.025; Thu, 13 Aug 2020 03:38:49 +0000 From: Peter Chen To: mathias.nyman@intel.com Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, linux-imx@nxp.com, Peter Chen Subject: [RESEND PATCH 3/7] usb: host: xhci-plat: delete the unnecessary code Date: Thu, 13 Aug 2020 11:37:37 +0800 Message-Id: <20200813033741.13982-4-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200813033741.13982-1-peter.chen@nxp.com> References: <20200813033741.13982-1-peter.chen@nxp.com> X-ClientProxiedBy: SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) To AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from b29397-desktop.ap.freescale.net (119.31.174.67) by SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.15 via Frontend Transport; Thu, 13 Aug 2020 03:38:47 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 863f36a2-6bf4-4c73-6c9f-08d83f3a6415 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3654: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2512; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7157.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(396003)(376002)(136003)(346002)(39860400002)(6506007)(478600001)(316002)(26005)(6666004)(36756003)(6486002)(86362001)(4744005)(186003)(6512007)(2906002)(66946007)(6916009)(66476007)(66556008)(4326008)(5660300002)(956004)(2616005)(16526019)(8936002)(8676002)(52116002)(1076003)(44832011)(83380400001);DIR:OUT;SFP:1101; X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 863f36a2-6bf4-4c73-6c9f-08d83f3a6415 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7157.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2020 03:38:49.5412 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: F/SwrHlR+qCK0VLF+NClFriNii9MyQKPpandu51zLwcqn36G7jnzpqaeP413s5PBuztvNt2diUvStmldB2M+rA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3654 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The if {} condition is duplicated with outer if {} condition. Reviewed-by: Jun Li Acked-by: Mathias Nyman Signed-off-by: Peter Chen --- drivers/usb/host/xhci-plat.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index c3ce4d762adf..07ca000a0084 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -283,8 +283,7 @@ static int xhci_plat_probe(struct platform_device *pdev) struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); /* Just copy data for now */ - if (priv_match) - *priv = *priv_match; + *priv = *priv_match; } device_wakeup_enable(hcd->self.controller); From patchwork Thu Aug 13 03:37:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 11711635 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ED760618 for ; Thu, 13 Aug 2020 03:38:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D49B0207DA for ; Thu, 13 Aug 2020 03:38:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="RR8YSBjG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726611AbgHMDiz (ORCPT ); Wed, 12 Aug 2020 23:38:55 -0400 Received: from mail-vi1eur05on2040.outbound.protection.outlook.com ([40.107.21.40]:46849 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726576AbgHMDiz (ORCPT ); Wed, 12 Aug 2020 23:38:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fdiez2d0kDFzYnHTIZtO/v9p/Zedj/5dsskEF3EBg1KWxtPgxW0s0EVJnYyjknrpILyP7O1MP6GAn5oarWIdI29XFgouVNYt+Yfz/A5aYRawqsyC5wAPpZNn5DMJEcLbiB5U2qzvnP9Gy1IRoKYTgHrI3Cg5A7WK2IZ/wBLoM7wPMbmyYDZoGyP7YQIx30V/qYfErNyQq1PzkjTLkXNRHiUOgfTxBNwfOoxWumC3hgCn/d5ALBlZVUgCwXUrO+RpXPtEZ3h7Oasqo8l64idxyIiT36ADG4608nRHVgS5jjF+afLCtvlrEJocGZeiel2Ko+7R3RoHg89C0mjmIBBK5g== 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-SenderADCheck; bh=qUQGhqU2QSjGJfTEsJ50YEPIEd+emQGe7ZzPcZUwZrk=; b=UzN3FI8omZ6SdxdsQjYnZ0fbWQr0YGpE1uBR12nCJT2sHkzejBALtLkSoR1aMxSehHE1pK5stapHTw4iKwT8LyUxfK3ct0Eskhrdb90oTcB9E0JWNrStCkErussc450lqotdvoGkJqQIUZqjfaevdkKDc0VXlOuyQUTvQFWjLfZZ3MVnCSfOHXO0VmdovhLXTkuA3tk6jcC5aUw2SZc43pYT6M2CjJB+W0aCiiVxboVmd/nSnYe7wCX/wtzhWQ8AxNpqpHJE8Z1u88lE6DGkguOhiMM9ETiZyD/hVNqVUeixFTE5AMjUsaBBCIq95kp99qC8WAAlISTdazGmw9VcuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qUQGhqU2QSjGJfTEsJ50YEPIEd+emQGe7ZzPcZUwZrk=; b=RR8YSBjGNoo1KVaztSwDa82yWcLb9GCNgsyiLvGdKHfyP/BNlz1dddXcZBurXiWJOSk0KFes4SJ3+56Ae67uuCbaNOKLPSOjf1vysM16lVWIDixWeRi/IPdeC+VWd8ujqtO6rAQ1gKaUAU9nnVCsUDBXfGkqqGYm/l9tQvDCM0U= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) by AM6PR0402MB3654.eurprd04.prod.outlook.com (2603:10a6:209:21::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16; Thu, 13 Aug 2020 03:38:51 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::ed7f:8755:5994:7fcf]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::ed7f:8755:5994:7fcf%5]) with mapi id 15.20.3261.025; Thu, 13 Aug 2020 03:38:51 +0000 From: Peter Chen To: mathias.nyman@intel.com Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, linux-imx@nxp.com, Peter Chen Subject: [RESEND PATCH 4/7] usb: host: xhci-plat: add priv quirk for skip PHY initialization Date: Thu, 13 Aug 2020 11:37:38 +0800 Message-Id: <20200813033741.13982-5-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200813033741.13982-1-peter.chen@nxp.com> References: <20200813033741.13982-1-peter.chen@nxp.com> X-ClientProxiedBy: SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) To AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from b29397-desktop.ap.freescale.net (119.31.174.67) by SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.15 via Frontend Transport; Thu, 13 Aug 2020 03:38:49 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a5806590-303d-44f3-25e8-08d83f3a6567 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3654: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7157.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(396003)(376002)(136003)(346002)(39860400002)(6506007)(478600001)(316002)(26005)(6666004)(36756003)(6486002)(86362001)(186003)(6512007)(2906002)(66946007)(6916009)(66476007)(66556008)(4326008)(5660300002)(956004)(2616005)(16526019)(8936002)(8676002)(52116002)(1076003)(44832011)(83380400001);DIR:OUT;SFP:1101; X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a5806590-303d-44f3-25e8-08d83f3a6567 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7157.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2020 03:38:51.6529 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Eg3l7sHQteGMRy6ISvK0ixCVuMHGw+rbWbodoEZ2gq8s9vOgGkKKgYeL3Z7f3x8AsxkPyFrKez3ChxLjuhewag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3654 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Some DRD controllers (eg, dwc3 & cdns3) have PHY management at their own driver to cover both device and host mode, so add one priv quirk for such users to skip PHY management from HCD core. Reviewed-by: Jun Li Signed-off-by: Peter Chen --- drivers/usb/host/xhci-plat.c | 8 ++++++-- drivers/usb/host/xhci.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 07ca000a0084..14ff65a387e8 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -183,6 +183,8 @@ static int xhci_plat_probe(struct platform_device *pdev) struct usb_hcd *hcd; int ret; int irq; + struct xhci_plat_priv *priv = NULL; + if (usb_disabled()) return -ENODEV; @@ -280,8 +282,7 @@ static int xhci_plat_probe(struct platform_device *pdev) priv_match = dev_get_platdata(&pdev->dev); if (priv_match) { - struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); - + priv = hcd_to_xhci_priv(hcd); /* Just copy data for now */ *priv = *priv_match; } @@ -329,6 +330,9 @@ static int xhci_plat_probe(struct platform_device *pdev) hcd->tpl_support = of_usb_host_tpl_support(sysdev->of_node); xhci->shared_hcd->tpl_support = hcd->tpl_support; + if (priv && (priv->quirks & XHCI_SKIP_PHY_INIT)) + hcd->skip_phy_initialization = 1; + ret = usb_add_hcd(hcd, irq, IRQF_SHARED); if (ret) goto disable_usb_phy; diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index ea1754f185a2..7658abdfca28 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1874,6 +1874,7 @@ struct xhci_hcd { #define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34) #define XHCI_SNPS_BROKEN_SUSPEND BIT_ULL(35) #define XHCI_RENESAS_FW_QUIRK BIT_ULL(36) +#define XHCI_SKIP_PHY_INIT BIT_ULL(37) unsigned int num_active_eps; unsigned int limit_active_eps; From patchwork Thu Aug 13 03:37:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 11711637 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 595F7618 for ; Thu, 13 Aug 2020 03:38:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41E97207DA for ; Thu, 13 Aug 2020 03:38:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="KvLDm6Aq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726615AbgHMDi5 (ORCPT ); Wed, 12 Aug 2020 23:38:57 -0400 Received: from mail-vi1eur05on2040.outbound.protection.outlook.com ([40.107.21.40]:46849 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726609AbgHMDi5 (ORCPT ); Wed, 12 Aug 2020 23:38:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P3ShJ4STc57qaZlNNdQKp2FO7KlSCGDZQoyJLjlUvzh9RybiZHVLKzNKG8I1ipgmZF52C38+Vle58XrpUhDJAxj6NWo1SBo6x1EHFNtlYEjrYLXiCFgXa4wLIsOCkDEVJBAL1eeK4GWaYoHl5cAxc3neJelyMJrEqf6S1FG5ht2ywA5yxQLR5iv4BMzE6CMYICHyLTq8X3Wvib/yH+Tx/UZOSdFI6fizDCxaj6zcu0N2zaf3YNww7ixnklqmb/cEYVb2jR85OrgbGBwdxQWvTwqR695t8tMHZZSrpt6YHb8zi0SbH7KfoDalZkVBjBVv11UFLXT83S4GJGirlAPWFA== 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-SenderADCheck; bh=mRl/ylQG2aONhGqipVD7pQ6fmtBbrKFA9Bxxno40V2U=; b=nZGM5XtoNDlekYejANsYgYtQ6Y0uBjWwm4mTPkbWwdklmAFdru+AMefsMPo+7f3nq/xe+ECS9UpjxmZwHQxeBb9UI8otitaM+qr04LoAle0ADIjL31SyTmB0pM1t1eVlcTm7S38k12skmchDWVZ6W7qleUhh80sT2ZC6v1faKW56ywneILJOlg1vvShZSV4DPeZRHqdDygiONKlslVvKfUFBYX4cwTeYtSGU0AkDxTNvz4zKn80TSlPBLKoykAgChht04bqZos50P7ixq2VjjJy6abpltHOyuKnETbeNyyZML0HVmqys+qs4Nfcl/0pSfkJJFvpXOk5PvlksC6ldJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mRl/ylQG2aONhGqipVD7pQ6fmtBbrKFA9Bxxno40V2U=; b=KvLDm6AqcH9ZvuEvTwedsp8/ZITzB1aaG6ZmdoWhYm9cV6uoIYTNPl0P3fTmJwmgpTlPyLw6wcAzpzfzobi0WNbE5kfZcxFPFsWnZorz7Pu7Rw2vFsucyyfG5u0xz/DVEXTI/vgbkNzuJv7zRan+65zkP9CeRjIMvq0sfH134WY= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) by AM6PR0402MB3654.eurprd04.prod.outlook.com (2603:10a6:209:21::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16; Thu, 13 Aug 2020 03:38:53 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::ed7f:8755:5994:7fcf]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::ed7f:8755:5994:7fcf%5]) with mapi id 15.20.3261.025; Thu, 13 Aug 2020 03:38:53 +0000 From: Peter Chen To: mathias.nyman@intel.com Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, linux-imx@nxp.com, Peter Chen Subject: [RESEND PATCH 5/7] usb: host: xhci-plat: initialize device wakeup default enabled Date: Thu, 13 Aug 2020 11:37:39 +0800 Message-Id: <20200813033741.13982-6-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200813033741.13982-1-peter.chen@nxp.com> References: <20200813033741.13982-1-peter.chen@nxp.com> X-ClientProxiedBy: SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) To AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from b29397-desktop.ap.freescale.net (119.31.174.67) by SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.15 via Frontend Transport; Thu, 13 Aug 2020 03:38:51 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 695edd2f-8c62-4882-52e0-08d83f3a66a1 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3654: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7157.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(396003)(376002)(136003)(346002)(39860400002)(6506007)(478600001)(316002)(26005)(6666004)(36756003)(6486002)(86362001)(186003)(6512007)(2906002)(66946007)(6916009)(66476007)(66556008)(4326008)(5660300002)(956004)(2616005)(16526019)(8936002)(8676002)(52116002)(1076003)(44832011)(83380400001);DIR:OUT;SFP:1101; X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 695edd2f-8c62-4882-52e0-08d83f3a66a1 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7157.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2020 03:38:53.8174 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ed+lcFY1nZvxsvpQi0jR9lO7gGz7Sc0Reyms2Yyz3ASo4V/vmWGkbanJNW7I2+3biCtu0AWn/2sOPcCNxPtWUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3654 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org It initializes the controller wakeup setting as default enabled unless the user changes it, whether the controller responds the wakeup event depends on roothub's wakeup setting since the wakeup occurs at the bus not the controller itself. With this change, the controller uses this driver could have wakeup capability due to device_may_wakeup(dev) at xhci_plat_suspend is default true; without this change, this value is always false. Reviewed-by: Jun Li Suggested-by: Alan Stern Signed-off-by: Peter Chen --- drivers/usb/host/xhci-plat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 14ff65a387e8..0ef28b2caea3 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -287,7 +287,7 @@ static int xhci_plat_probe(struct platform_device *pdev) *priv = *priv_match; } - device_wakeup_enable(hcd->self.controller); + device_init_wakeup(hcd->self.controller, true); xhci->main_hcd = hcd; xhci->shared_hcd = __usb_create_hcd(driver, sysdev, &pdev->dev, From patchwork Thu Aug 13 03:37:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 11711639 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9894B1392 for ; Thu, 13 Aug 2020 03:39:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 822EF207F7 for ; Thu, 13 Aug 2020 03:39:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="q1IpFj2u" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726631AbgHMDjB (ORCPT ); Wed, 12 Aug 2020 23:39:01 -0400 Received: from mail-vi1eur05on2040.outbound.protection.outlook.com ([40.107.21.40]:46849 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726576AbgHMDjA (ORCPT ); Wed, 12 Aug 2020 23:39:00 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RgHgIfeLxtxRfJuMsTdywNKcqbc6vG4yyPiWEJuOff4caBIQ6HDhHex7/EIyJFEKX7eLU/0lL6xsGVcG+3PtiVJtX6fNY17XkN4ayo3pFxg63TDYAS/B8Pta6WVoNsbEIRVUmtUrT03o+N9n5qBxeidrRms4bHJ2zGNsEiuuu9DKQnFRNoC4khqVOcoMrS3byY9s4uq3toKJK8wGXLOIiRWi1UUvW7jQbq71kqliMo4Y7hTB2cYO8PSR50OiitjpvwxmN8buQDFlS1/DeIeKa2qywCTdE8oTh13DlJ876oWXHYcwYnHos/5JY+KkhaHyg+Q9pByHZDqps36USfsjsQ== 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-SenderADCheck; bh=SAMDPVNMui449JSukPWPPS2D9k5beTUCvuOBplnFeGE=; b=bpL6NQ0mIyorrgmUTW31ZxHalq2cyka5pzP3CnWCbEYbHyWbpSnjk5cvfFy5+kfOiU+0l49UBek5xVn6HIdcTKYKXdqL/QP0sZs6dGytWvsB/7TfOXXo4Oc+fms6/bpH23o2qmluy7SUeEerl0DUsLrMBz9rcRMhV2YCmjEBHNh9ffhQ4GT5hRc8yZKTponEL3mHKiUl5oF7kce+xjmiujUkj0kpJC7Vae0JwJlkCGQ/I3VyddDUiZTKlOl0IYA7EmwehvTndnP/VJwcDn9v8M/jJWDsv22Vx2Cpegi4ctaRuOU+DwEEHmbXlxcT+ZgWYTKexICxp23t6B2FkHnOqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SAMDPVNMui449JSukPWPPS2D9k5beTUCvuOBplnFeGE=; b=q1IpFj2uOXT53B7sDkHJhB7Ttvpx8Byf85kZDiwnhdSNM24657LBeOtDxbX8y9aCqP66SJGTg/mkcYEd/gR8/Ssk0alppbn3IOjHaNXVI6+0OYZpsZch6IYAZMPvGNKOVQYTTWt8LtLfS/SPXBeI1g8t2ofizVzUeiQGr9bpSzA= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) by AM6PR0402MB3654.eurprd04.prod.outlook.com (2603:10a6:209:21::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16; Thu, 13 Aug 2020 03:38:56 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::ed7f:8755:5994:7fcf]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::ed7f:8755:5994:7fcf%5]) with mapi id 15.20.3261.025; Thu, 13 Aug 2020 03:38:56 +0000 From: Peter Chen To: mathias.nyman@intel.com Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, linux-imx@nxp.com, Peter Chen Subject: [RESEND PATCH 6/7] usb: host: xhci-plat: improve the comments for xhci_plat_suspend Date: Thu, 13 Aug 2020 11:37:40 +0800 Message-Id: <20200813033741.13982-7-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200813033741.13982-1-peter.chen@nxp.com> References: <20200813033741.13982-1-peter.chen@nxp.com> X-ClientProxiedBy: SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) To AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from b29397-desktop.ap.freescale.net (119.31.174.67) by SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.15 via Frontend Transport; Thu, 13 Aug 2020 03:38:54 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: bd7abeda-cecf-489b-fed8-08d83f3a67ea X-MS-TrafficTypeDiagnostic: AM6PR0402MB3654: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7157.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(396003)(376002)(136003)(346002)(39860400002)(6506007)(478600001)(316002)(26005)(6666004)(36756003)(6486002)(86362001)(4744005)(186003)(6512007)(2906002)(66946007)(6916009)(66476007)(66556008)(4326008)(5660300002)(956004)(2616005)(16526019)(8936002)(8676002)(52116002)(1076003)(44832011)(83380400001);DIR:OUT;SFP:1101; X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd7abeda-cecf-489b-fed8-08d83f3a67ea X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7157.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2020 03:38:55.9829 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7smKU7bjXgu6KQZ6S+2ccib4bdxUV3I3BhgR6V6HJhjZDhmlFwE6oT5p5QbmaSJHAAhSN0aam2UXrXmzRTKjCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3654 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org To reflect the current code status. Signed-off-by: Peter Chen --- drivers/usb/host/xhci-plat.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 0ef28b2caea3..7e2eb0439c03 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -421,11 +421,7 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev) return ret; /* * xhci_suspend() needs `do_wakeup` to know whether host is allowed - * to do wakeup during suspend. Since xhci_plat_suspend is currently - * only designed for system suspend, device_may_wakeup() is enough - * to dertermine whether host is allowed to do wakeup. Need to - * reconsider this when xhci_plat_suspend enlarges its scope, e.g., - * also applies to runtime suspend. + * to do wakeup during suspend, the wakeup is enabled by default. */ return xhci_suspend(xhci, device_may_wakeup(dev)); } From patchwork Thu Aug 13 03:37:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 11711641 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AEAF51392 for ; Thu, 13 Aug 2020 03:39:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9650D206A4 for ; Thu, 13 Aug 2020 03:39:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="mMh4Fjkx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726609AbgHMDjC (ORCPT ); Wed, 12 Aug 2020 23:39:02 -0400 Received: from mail-vi1eur05on2040.outbound.protection.outlook.com ([40.107.21.40]:46849 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726621AbgHMDjB (ORCPT ); Wed, 12 Aug 2020 23:39:01 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nMpvvAk77Ee0fyp53VqphuuzMTvnB/eFOJCeDkIBfeyfKNfv5G6UMKJZTXhip3QD+AmMvNkzFQaglQYfSxYLQVCfuJ6CuGDPBdn0Qt/AofvAPx5kYpSuUJFiv6d/7dj5Z5sYrknvmlrSamdZygg0cMAFUzkkxUPAqXlstoKMIGpMMfdRHvwVdPYqCCT+wxMV5bQn27Fc0wSynHkZt2ooNvzfeBwqiz6ilgIK0XkRu57J0E32UyEJ3Guv2g/pQSqxh7T1tpRTQCJXfGfEyDG+8QOxfhQ9LhllRjAn7D7pACznkAOwZnn1TegEKR9B+QJHjxFLGY/AR8fpi+acAjknsQ== 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-SenderADCheck; bh=GiygfphVRc6jCRLTweWBo0aa43+acXpEU7O3O1eRSHM=; b=d3ywwgD/z0qjD+lIMUWFfR7HhYhI2gM1TNQhyZ2QdXiHp/u0gV6HqfM/MN6TZAhvpf2p5p9Y3Z9gQTwzYRpo9kI5b7+L3m56+kULe5UEXj9IxA/7mH1zfaAEsqFGLBTCUvwp/0CRlBzVzUI6nsUhDINV+ENQBpuYFEEE2kmxO3Ug/Q1HrFMjdj04gm5LCn3jddjCDf/2gSe5o0gI+rabHNGJanPE4U4LYwxsraukQ8V74QvcMc6Tb395ZTkb8uizWWXbG8ruKdZXJTmN1sYS2ABbpDvAAnaOG7WNczwRo8268j//LgM7ZK42tOWo3ZR/iYQ2G5n9S/lmU/Q7GrXNdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GiygfphVRc6jCRLTweWBo0aa43+acXpEU7O3O1eRSHM=; b=mMh4Fjkx0EA+8irnRHDX/vwbHwJuWqC7g7FOOcdr23d6xfOLDCfrxMqOeLtRdSDE7j/4XhQwX57spGuomoYgx0OXUbLtGJUR6Yq36qIMzUuo6uyaC2IFZxkEbfTCaSd7aT0PN/BREMfUkplL8myGKspSB524Olb2Z9pQV9GiJlA= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) by AM6PR0402MB3654.eurprd04.prod.outlook.com (2603:10a6:209:21::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16; Thu, 13 Aug 2020 03:38:58 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::ed7f:8755:5994:7fcf]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::ed7f:8755:5994:7fcf%5]) with mapi id 15.20.3261.025; Thu, 13 Aug 2020 03:38:58 +0000 From: Peter Chen To: mathias.nyman@intel.com Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, linux-imx@nxp.com, Peter Chen Subject: [RESEND PATCH 7/7] usb: host: xhci: avoid calling contineous two times for xhci_suspend Date: Thu, 13 Aug 2020 11:37:41 +0800 Message-Id: <20200813033741.13982-8-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200813033741.13982-1-peter.chen@nxp.com> References: <20200813033741.13982-1-peter.chen@nxp.com> X-ClientProxiedBy: SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) To AM7PR04MB7157.eurprd04.prod.outlook.com (2603:10a6:20b:118::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from b29397-desktop.ap.freescale.net (119.31.174.67) by SG2PR01CA0142.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.15 via Frontend Transport; Thu, 13 Aug 2020 03:38:56 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.67] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f48e7fca-af9e-4392-3ffb-08d83f3a6937 X-MS-TrafficTypeDiagnostic: AM6PR0402MB3654: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7157.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(396003)(376002)(136003)(346002)(39860400002)(6506007)(478600001)(316002)(26005)(6666004)(36756003)(6486002)(86362001)(186003)(6512007)(2906002)(66946007)(6916009)(66476007)(66556008)(4326008)(5660300002)(956004)(2616005)(16526019)(8936002)(8676002)(52116002)(1076003)(44832011)(83380400001);DIR:OUT;SFP:1101; X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f48e7fca-af9e-4392-3ffb-08d83f3a6937 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7157.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2020 03:38:58.0439 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zO5K6KG03RQLvtGRN+cf34ljFBCyjld5K7ZQdz8rMej7t1duIbcQW4Uzh7uAPGAGxhvl8+ydZS4n41FIgDzCWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0402MB3654 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org If the xhci-plat.c is the platform driver, after the runtime pm is enabled, the xhci_suspend is called if nothing is connected on the port. When the system goes to suspend, it will call xhci_suspend again if USB wakeup is enabled. Since the runtime suspend wakeup setting is not always the same with system suspend wakeup setting, eg, at runtime suspend, we always need wakeup if the controller is in low power mode; but at suspend system, we may not need wakeup. So, we move the judgement after changing wakeup setting. Reviewed-by: Jun Li Signed-off-by: Peter Chen --- drivers/usb/host/xhci.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 3c41b14ecce7..cde71f3b9767 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -982,12 +982,15 @@ int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup) xhci->shared_hcd->state != HC_STATE_SUSPENDED) return -EINVAL; - xhci_dbc_suspend(xhci); - /* Clear root port wake on bits if wakeup not allowed. */ if (!do_wakeup) xhci_disable_port_wake_on_bits(xhci); + if (!HCD_HW_ACCESSIBLE(hcd)) + return 0; + + xhci_dbc_suspend(xhci); + /* Don't poll the roothubs on bus suspend. */ xhci_dbg(xhci, "%s: stopping port polling.\n", __func__); clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);