From patchwork Mon Aug 17 09:44:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 11717823 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 F2F9E109B for ; Mon, 17 Aug 2020 09:46:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D912D20738 for ; Mon, 17 Aug 2020 09:46:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="aD9JtEKL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726685AbgHQJqA (ORCPT ); Mon, 17 Aug 2020 05:46:00 -0400 Received: from mail-am6eur05on2075.outbound.protection.outlook.com ([40.107.22.75]:62688 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726424AbgHQJp4 (ORCPT ); Mon, 17 Aug 2020 05:45:56 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GZcfh/xikKSX/yqndp81nSICSQ2PDmQQZQuoXqaBM6kqLmVUSEi0L6dVru49qWfNatGRzcDTLxGiAqgOTe4AEykB0MI0jXnV7uZpbn6F0FAdpkyS6STShArMpwqAwn4DXN9Nq3Q80Kl/skx8xKo7oKXkHxbjC8PWf3Hilaz7oI1PkZTAlejBRMBlth3Z2y4nq5ClunMn/krTRsQETNnfGigsKpWldPJWmDdhzLHRi7IfMt+Zg7iIORIe8XqMj1u2qOHlWOQzIEtMLAWcgOPf8KnYoVc2jgaUDCHkGxbIWOxLbVwsLGvBNiwe6nARim9+YOFvhOOIpwIzYCzJJM0/Mg== 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=Pfw78LS/rJrFKVJHE1A5A2ONjlB2Llhko8KpuqX3+dPQt5x/WRQcTCBnit4B0+ldcJJmouSA6mGTkkNWudyGVKNCPDN3694K808vHoB/U0Sg7I6U7VppqvtOSVPEQRVU/5jmfQOxOCMwYgOnn19X8m4jVo6ZaYOm5BxNY1oPPLtEbXYqzqV9WmhGdyMfpu3yNKRaVVFJ4jpgY5R6SVseWDgqJppPYXmJR1hTSHjCwyaEeZwqLZtogTdmuCBzx8O6QflAUN9LfVlWaLxcMqHSTdz5V7Hcc5okpAIxucy0w7Hgcpkal/sjJK9GpervlcB4l08D68/mGSZwyuHqZbIlrg== 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=aD9JtEKL3L0bN1yQbjp+Irdkly0kGMwLdm+qUGXIM2V6DTdwMy1BETuBbp6LPZDgUkljVTK4bE+/TcWAGdhtdccevEy1uBiTcIwaBFQJMoTSoXqML2vqLumZKmO2HCHrqxuEYEbH8JkMlAdWoG83NmjxaAFHduJmSq2Uh2/d4BM= 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 AM7PR04MB7160.eurprd04.prod.outlook.com (2603:10a6:20b:119::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.26; Mon, 17 Aug 2020 09:45:53 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1023:be8d:40c:efe1]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1023:be8d:40c:efe1%3]) with mapi id 15.20.3283.028; Mon, 17 Aug 2020 09:45: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: [PATCH v2 1/7] usb: host: xhci-plat: add platform data support Date: Mon, 17 Aug 2020 17:44:34 +0800 Message-Id: <20200817094440.23202-2-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817094440.23202-1-peter.chen@nxp.com> References: <20200817094440.23202-1-peter.chen@nxp.com> X-ClientProxiedBy: SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) 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 SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16 via Frontend Transport; Mon, 17 Aug 2020 09:45: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: 89f03043-18fa-46b7-f0bd-08d8429254cb X-MS-TrafficTypeDiagnostic: AM7PR04MB7160: 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-Microsoft-Antispam-Message-Info: k9fYMz07c1iFp881vqVHqhePwxc4doqZgAj4IHcYKM61TNjxJNTx/ThNoxtF6hW52HrZ5UxhHxeUctReYc/1AewhCLjWPJNbOb0W2mTvZ1zUuB3YSJCkrdZS2jH2ebXhyDdspbxCldUP8df6mzDKXH2S7PI5kvif/uVENKq/hCDF9STMbc4WtCEymxO1xnwLqaeFV4r/1jW+jdtO94AVo/B1aePJLxOH8IF0T0radRksEsht3ZhsVjYQVv1Dq1ywyhprpuxGeiWNIKmiB3TnJq04zYHDV5CDVjknu+tSBUbnG3OyanoEMgTEu9VvR5NkjTqc6RGLrG47slTSidPPcA== 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)(396003)(366004)(39860400002)(346002)(376002)(136003)(6506007)(6666004)(4326008)(66946007)(1076003)(2906002)(16526019)(5660300002)(66476007)(52116002)(6512007)(6486002)(66556008)(26005)(186003)(478600001)(83380400001)(8676002)(2616005)(8936002)(956004)(44832011)(316002)(6916009)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ZJjrM3tJXL5kQ50s6LbjFlEHGlYsXjBjAHi4oUbovAfdiLOLGt0lHudt8hpvenBAoTUKFNS5rn+ULFHn3sM8pMsvS5mkvMg0pJUBkFiePdopM6D4bBMarkrhyI2hhdhvw43UU64IDRP16if2ovEULxD61Ooft2dChZWhYFoMgN61+JiL6Ug4SFjo9nILl/mew5Q1ehe0ll+su1pS3dVDq3soN1RoIxq9g3I0fpV0lXR41FEq3BhzJllUYPleUVUDW3HjwY9W8EsUANRD7U78D5VvlsdEgfBMkEGF7zUXQRJp+TD4EL6bHLxpwM88NHXA4VCAN/pPmb67wreMeIM4Lr5YAB+yQ7QLgxBi+dskTteBo6wO9KJ/dLsw6QZKyAMpvpg8FvgleGO0vJKQZQE2J31V8QSI+N+SUUz5DvYX8uL8K+fBlYHTDz6Y+o5B4Fyf5D7vrGJRSW0vlbSSlqUp7mslIt9So6CWAjgmeWAWlJ3Yh1s/owG2wE+G/DxmaPlW1uNd96xkUaG2Wrap+GbAiVNxx699wz0H2VxcMz10Jx4LKn4WjVEO90R+lDqSwGImWzqlxImKw30QMabEKXQc39QgCqVPvtw/3yfR9tBRFOZhYLxFonybbu5EAmMbliYCScpmT2z267DwISLsIOfAxw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89f03043-18fa-46b7-f0bd-08d8429254cb X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7157.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2020 09:45:53.1690 (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: nSe5U9ROwz8vKKVQw+oqyITt7If0EI4d9NmsKgAyyxzaTdwEW+qIzPPsocFepRx8fUPz6m2qj/3MeU+fo4Im4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7160 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 Mon Aug 17 09:44: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: 11717825 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 A148C138C for ; Mon, 17 Aug 2020 09:46:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7BA02206FA for ; Mon, 17 Aug 2020 09:46:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="FcdOCpMs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726752AbgHQJqh (ORCPT ); Mon, 17 Aug 2020 05:46:37 -0400 Received: from mail-am6eur05on2075.outbound.protection.outlook.com ([40.107.22.75]:62688 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726324AbgHQJqB (ORCPT ); Mon, 17 Aug 2020 05:46:01 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LIbBn1uPnuT+QIjc4Hls8X1PSxQ0vFuhUTw68zl+NkTm+HJQXmlRAUG6kb6AO7yXwIrIi9TNB1Re9hqgZDm8UjdlbHZVvrNT0nfQSvdvSZVawTx24ght1vvB4ZERJgm3z6ZMmh4pjjkwXClUUEWiXs6WfmagtkUdvxalXoc1MTYgxJw86j893lExuNMwzj/djeH2v+NheD1n8J4hiHXLMj68R9elDR7AAGaK0YsitCx6oY2SixMEL+9ZZ/E1U+nA3eyHKrPe8JRvE8Jk98w3cZaJ2zR784Xi9HYbWY4o3zrTaOblMITzhBu+cfPHnkGmBy3pEMq1xPCaxpxyQMrkbw== 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=JuX4GbgN5ztO+Ai/fQep8U4U8YNZkoLq5Ig0P0HHhCWIQAbdONH19wZ4lXk4gc1pi748iwVo9H3DpPm4cJcZRfHCn32mb2grVaFEkgMpBwSWFYyfE16tPss9P/pGmUKCLPP9VyKOf4VZBXEn7Q1hDs7ZrqZw1KOYS1hV9Y5kGGTWlR2pTLIIIUxHveZA7+mPCzPeCLW7tqh0CVl8jHB71aLDcRv27hiuc1XwSgjs0gXB1NM/jrcWpdJt0RaaygB5vg4Ws815MS9efv3Z7FWErqk/mLgVhQYMvazhsENxfJs5ppwWbDq2MFcmsCqJOnfcFhepCbipS/CPe1MW9cp5xA== 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=FcdOCpMscsnZm/SWh3P3KQAlqTDg1oGYmTXraU0JOwObkLrwdNJkYzW63AbJwm1eDhz9Uvp42EK9sSotuJcdX2QoxcetDGBzvqOc31Nvov/bAtBIAmUp1vYkojQYH/NhCMyvfRYkuLyg7jVw69UOjiRHIEMtF4WcZ6gCukNOuAU= 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 AM7PR04MB7160.eurprd04.prod.outlook.com (2603:10a6:20b:119::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.26; Mon, 17 Aug 2020 09:45:55 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1023:be8d:40c:efe1]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1023:be8d:40c:efe1%3]) with mapi id 15.20.3283.028; Mon, 17 Aug 2020 09:45:55 +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: [PATCH v2 2/7] usb: host: xhci-plat: add .suspend_quirk for struct xhci_plat_priv Date: Mon, 17 Aug 2020 17:44:35 +0800 Message-Id: <20200817094440.23202-3-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817094440.23202-1-peter.chen@nxp.com> References: <20200817094440.23202-1-peter.chen@nxp.com> X-ClientProxiedBy: SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) 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 SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16 via Frontend Transport; Mon, 17 Aug 2020 09:45:53 +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: d5ffb376-c152-446e-69f8-08d842925631 X-MS-TrafficTypeDiagnostic: AM7PR04MB7160: 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-Microsoft-Antispam-Message-Info: UmAXGo5qqDFEx2TbufJqxpNalJki1G9AUIBK2yDAtbLtiW0RzuPR3dtQxP1QprGGOFOMZXCv5sVAJ+cuKnJ3TefFfs93MiNGt4tIAEz/MuSHH8ckEft7dUUQ6LFsTUdpeyYPPCSv6o1TlDN3HlSZgIaKsD3ecSqBC6/MBtzTPRjdKBRhMEYCzPBh4eAAIaztLanI3f46kAxk2JxzzqIezEBYoGkkn1i8g81gWpYuDgRcNfPU/ERKCL4KSXr6/P+r4yddBoA/K2dPEGADCIlksCJKIimTg00whEA9B3hnAHOCwwbknSgJvWn+XmOpqHamiJOlwu1M/9fxMFF0FF/HSSR33iN+v9osOwgqjXnxBwIJgMENcnUA/LEXqa7w9p3V 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)(396003)(366004)(39860400002)(346002)(376002)(136003)(6506007)(6666004)(4326008)(66946007)(1076003)(2906002)(16526019)(5660300002)(66476007)(52116002)(6512007)(6486002)(66556008)(26005)(186003)(478600001)(83380400001)(8676002)(2616005)(8936002)(956004)(44832011)(316002)(6916009)(15650500001)(36756003)(86362001)(142923001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: MQUPNV3Az/CBEomwIO0PsOECqRHDtEYWYTT6YE0tW1c38fKHdcUikCzcAFvmRkzgzdqG4TRUScWI5AifI7F4RiCx6aA9qBDfq4inpGMZS7bjzFL7vOZbxAULtJNeftwt3c2EMT7QNwhli0cszL1ve4ayFKC6ywIByxifrIflvMT3IR8yoa+E3t18+h1TWcioSSlcXL91h9UP4cZu24gHQ4S3W2JENQmk2g0KluFN3H9CO8gs4EDDVL7JYJUq9H3CrSGyVHsD77YsxxLO8SaM4b8qg4bXwW2pVW9rixo96vFt6jfyJh5atVc6T43v2zZD3baAZalptGEX4ZkXrjmml1/KVhelWWkug+BsiV8g51XINKt80uSLOAGq76LW0XAesFbVNsiPCYtaSpphv3gNA8eJOenaqMTd2dZTKu6gXr127wOWbz6bbDibDGRZL7S/uaEzQhXxB65b39vEVdtg+FBfuck7HgUGuspbIA7Bu+Whs1wVZUjyBaLbhQuuDB6+dSNlpgl8PHQd9do4LiaLREUJqfdN1u0jg59sRTKNsVD9G/mfA7G8U87yZ9FKUykL/A6ly+a9RmuQxb8Zm3fGzBj6tgOffmcdIR40Xk5nzPeWhS2NvZJsf6ISe1rPvCetuZ6/G81HVOdUtTR8gCZuoQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5ffb376-c152-446e-69f8-08d842925631 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7157.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2020 09:45:55.3564 (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: iUjDLsfVa1aL9z5ajnm/Lnf5zr4/noYK4T87j9pbPmJLMO5VSn9Gw2CHmboR6XbTNa+FMuqqAYD9be/NfRQFTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7160 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 Mon Aug 17 09:44: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: 11717829 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 76240109B for ; Mon, 17 Aug 2020 09:46:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5CBB6206FA for ; Mon, 17 Aug 2020 09:46:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="QcaVdHrq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726772AbgHQJql (ORCPT ); Mon, 17 Aug 2020 05:46:41 -0400 Received: from mail-am6eur05on2050.outbound.protection.outlook.com ([40.107.22.50]:21473 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726575AbgHQJqe (ORCPT ); Mon, 17 Aug 2020 05:46:34 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jnNM4OuPwAcSBpjsnXjOlmz1K74rtceugFHbn41DWmqJP9aNW0PoeXZOrDt0o3gPwLIULxSkNPSurCpe0ANSH4MMJzp0YdWeXrYmErJJKUMjryanHnPka3BFEBRKdAL62gRYJs8+/lkxL3cOH2JkYLdm0aU66GLnm/JMlnah+BOAQoVRXZcrWNgIaCdnUNiUyzDJe9c/WgZo8hJn2lLZuo9vXJJwhdJGIxft+2fu0Agdo1QEc9cKdVmajXk3EW5DE4m3o3DfLUlMLEUCeyTdbT/P+uPY3E8xIlQgLCU1+s2vj6XTcei6UatFWmracIs82Je2KrhD1/PFaBZwxcDfBw== 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=hn9gkhjx2/8PuY+GQlb7sRDR06bHEE5MWZ4/1Tfx77G9qQfcyIupyMVI3CCyJRTOTwMfuUpgLF99zCFtxatZZk0LedfHYDuEx7mhuXidA4dxRV96yNZecnDuNkY86BFCvkKrewlSME0DFaxO0MZxtSY/iH5K/F+DVHj3qkKjQoOH7NrfeGPFlyHqmDvewjPBj1U7ehWfy4GAsysBz2Zi7FwbI32jyafxV0EMQC2AkyPfdFR63ZMJLYE++3xRbF+9AStEHMHsu3oaskqtWrwEYGhGJs9OhmW2dMy1voo68r7ZD7khS6PPnDMkSzVh0iLnQ9wI4T9cAmHSPESV2fWRjw== 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=QcaVdHrq+I89u0KK1jxWtPX2VILcCy4RwSpKcdPRxinMjqWANBq9U/bsm07vZLHOR108dvkQew8++iQJowAe9Ts4jJ3IPv4LM84XE9EcV/95+mnBi0PMwk5alQjOTt0kYmDgGZKGddzwH6o4zAtFq50Bm7hQEOFwmxRdVbhi6x0= 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 AM7PR04MB7160.eurprd04.prod.outlook.com (2603:10a6:20b:119::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.26; Mon, 17 Aug 2020 09:45:57 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1023:be8d:40c:efe1]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1023:be8d:40c:efe1%3]) with mapi id 15.20.3283.028; Mon, 17 Aug 2020 09:45:57 +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: [PATCH v2 3/7] usb: host: xhci-plat: delete the unnecessary code Date: Mon, 17 Aug 2020 17:44:36 +0800 Message-Id: <20200817094440.23202-4-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817094440.23202-1-peter.chen@nxp.com> References: <20200817094440.23202-1-peter.chen@nxp.com> X-ClientProxiedBy: SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) 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 SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16 via Frontend Transport; Mon, 17 Aug 2020 09:45:55 +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: 846b61ac-9792-43ea-decf-08d842925779 X-MS-TrafficTypeDiagnostic: AM7PR04MB7160: 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-Microsoft-Antispam-Message-Info: O2CajCr2frkYRVY3gYLnwN4Bgcun2/1jF1RQ0meN6AZs/GErz1Gye8Wg8ZLu7ln14vgSsMLKuBy3Nul6N9tTAcHMEjwtjvAzLWswG7sX6ImQQLJtndWkZ5TRV1NN+ZpJePSGaWTpxN912VN1F50FKUV3xrnrc6OsolgQP1KV7Gq9V5mmncKOPsMqSWu3Nko5F7NuQeFr2Ai/PsZtXjTD8UUQIs6jOuOMRzFo8+nelKPrNeISXWq7auZONlUSOmP3fp+ctcu5nvaLEP0IOf258Z23WRJ7GUr4l8LUQX6bSZ0lRA30tc2KtVnFxMP3XMBoZeImS1HYIeUtyVAqrw7B6g== 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)(396003)(366004)(39860400002)(346002)(376002)(136003)(6506007)(6666004)(4326008)(66946007)(1076003)(2906002)(16526019)(5660300002)(4744005)(66476007)(52116002)(6512007)(6486002)(66556008)(26005)(186003)(478600001)(83380400001)(8676002)(2616005)(8936002)(956004)(44832011)(316002)(6916009)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 5amGFsIgnbvICXBrJyES9KbYZ6YCWCfuwgc4yEmKd16II1jsm0wVRaNeTo4me3i8MHhJTTxzUIUb6ln09Wiq9JXrV7XjryC+QFBj1aI/XwZCPhQ6HtRvyA7k6FM635G0Y5zd8ZcjIUneb+etzUZCQGl2D6wC6DOsGj3+LNgqBI+XGi6Mhq7fPGvQnUXwZzh+WRo+xxdOXegL9NtQggJ7TFvHvipvtyHz9xNhJOjU7Sqrn166rMzQiRc4T8wD34obydcWEqwSS7fvi5wf/zv1mAXkotekj8/AAVYpW96HT35OXpofPrbhq2k7C7PWaanw6Kzf5OmayErGUa09vUw0FCPi4nLsrdMErNlemzaL8cScqX8AiixrgzH7FDa4fKkhheZFlUvNInAczWtYGWTy42fRhi/Ua1J9d75AnqYBup+B8dZdOkC4pkSXr+8TW+w8LmoBSF2vPEiMt6YaL/J7qcKZF0fC+iQF0LSh2w3mTomH6mCQZhoK7+cJcgUf//5lh4mpdkKvsYEDuuPnmTHObiIFhct6Us7OcB2oVirKHtvQuSbln+GSOtw6I3NsNiunEDGzJAcabATWhg5fhdDeO2dCAjC/4iyypX61NQcwaXHaeYQrjgV+2IK4jMrw3rRzUghHqAsvpKwlx+Dc1Jbd/A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 846b61ac-9792-43ea-decf-08d842925779 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7157.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2020 09:45:57.6623 (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: OBRpeAnJhBVvn5oX64lCvyF46E/52JsmHK+3GVFwg5OI0EPzt/YstI+NASBSat+X8uzL3NcKdVrZ5C7iBQmQVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7160 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 Mon Aug 17 09:44: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: 11717831 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 C8857138C for ; Mon, 17 Aug 2020 09:46:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AAC05206C0 for ; Mon, 17 Aug 2020 09:46:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="SLVkvOsc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726777AbgHQJqm (ORCPT ); Mon, 17 Aug 2020 05:46:42 -0400 Received: from mail-am6eur05on2075.outbound.protection.outlook.com ([40.107.22.75]:62688 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726631AbgHQJqk (ORCPT ); Mon, 17 Aug 2020 05:46:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EnKJDqgIboKlYpJxHwtEYYbVd9Y9XnZTRlZol0lYE84moUDQnwPmDJ5B956XfNdGpxkjSZq5oFzdtRtcqBGXxnkNjjv7mRcd263rL2Qns0Ah30WmfKIS2PwhUOVXGTMmxYsHUFDtFHTPPB4IPyRDOHa3frhOxXUwvJXr/AeBv0fXADrwKSjTJ1+Y0FNBHF8XE5fc8vIVd/y1cD4w6fhOHJtIcxVuhQgCXjqk8JT0RLH7vEpp0vWnesDrl/ufeo/QCw2F8ELo9IsLI+k+1/xyG5vHsN1t86AGwVMG0OIDhajQefopaYJPYgAMz4lLuSJGTNrEC38uEyrp54OHfLnzIg== 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=P4Xdj6dMlHgiMLK+X4cH+Jof4UmuERiL7xD7DEN9qJCGRUHrBZHvwM1no93qSan6HE2aHPIuhBjLq9EjEYFlckyTqX/om2YekchPwl93yigLwxJJyrdocqQBcuaa5xHyPXXnQuOgwoC58pGwFKdCF2jvq61v6iYU0UuQGQlY7Hn93CD4js68taxDFeZ31K5j4hvNNoqGKWEpdTirGaRXM3PvfmrI5En2ej6DrzVmGVHnADI1N/KDbV+38ENk3dO8AXhXrbbcadeaUEsNlmAD8asD4JlePyNhjLOxbl7LhL09N7HBNnQr2bN3P24gpykHjXEZEvK+HszSVnI7j5ibWQ== 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=SLVkvOscWfgNjCRXqmJrdJ7HKL6EFuNzZA2Vr50+w/YSr2inEFJKFofvRkgDexkTlVHCXatrEEIH2liYG2uDLU2kNEXTNj+8ufgIgNNgX9b0M1TvQtzBMUNmKCyR14lwagSQw3xA8itZG4UBOjZmsyRlDAlDl0L+Wyl+21eIYYo= 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 AM7PR04MB7160.eurprd04.prod.outlook.com (2603:10a6:20b:119::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.26; Mon, 17 Aug 2020 09:45:59 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1023:be8d:40c:efe1]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1023:be8d:40c:efe1%3]) with mapi id 15.20.3283.028; Mon, 17 Aug 2020 09:45:59 +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: [PATCH v2 4/7] usb: host: xhci-plat: add priv quirk for skip PHY initialization Date: Mon, 17 Aug 2020 17:44:37 +0800 Message-Id: <20200817094440.23202-5-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817094440.23202-1-peter.chen@nxp.com> References: <20200817094440.23202-1-peter.chen@nxp.com> X-ClientProxiedBy: SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) 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 SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16 via Frontend Transport; Mon, 17 Aug 2020 09:45:58 +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: 26e77bb9-6d64-4f59-20e8-08d8429258de X-MS-TrafficTypeDiagnostic: AM7PR04MB7160: 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-Microsoft-Antispam-Message-Info: /ojoYUNeXY4wZOpRvquFq5ZXpPksaC8RtRb8jsLRWnHv0Wq1MgbqgbjjKPsVQtjv7D4BCtnJyy0yclUFlg3EBBcrHrMyIRG37PqzVFnO3M9qUPraKhlnQpunC85NLdLYkS2HVTT955YET2HiOl/NO1DNbcUtWsyDBwT3Qd3A9fjI71TCcufB3QEljG1KSvvbJuYVP37SUi66Q3gZj++oQWw8vOLnU9Vx9LqR/cC82EYEgKHG1wcORVLGu+8yzU9Gx1LQvQ0Dc7nycFpe8sEAlBBG//dG8Npoth9sUtnQtyWIQswmRMwwhOSDhD3mePItrPXVLvBoM0WsULVX2VOmYQ== 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)(396003)(366004)(39860400002)(346002)(376002)(136003)(6506007)(6666004)(4326008)(66946007)(1076003)(2906002)(16526019)(5660300002)(66476007)(52116002)(6512007)(6486002)(66556008)(26005)(186003)(478600001)(83380400001)(8676002)(2616005)(8936002)(956004)(44832011)(316002)(6916009)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: bfVf3jal6qvy0eQ4r2PfeV/EPC7SXZUGKMQv9xfSIXHLpzzeAOFHN7cI8sXWbp2wcME9J6d7vWIWAR0GqiVulmZgBCfde5TX3/pAq7xlb1IkUmvM0J7VAlZdq1f1j3tG1q5H+nXdvW0VX4D7Kr9oxc26MZn1UGOzr+eq+yaN/x/Fh6utDLWWiRtmmkpxMgAuTVSLXH7QAq4Fhj7H5ia3MpetQVmZroj9aaIzftFf+SfUvY2l+wKJ1diLQ2I2iiQPu5Dtu3rfJBT2mKC/++uFPu4q4M+sT9FUC+ZS5IhGXoXnBC+8pku6+Mu1d2l9e3+R1K1qmw5gKBwjPb4OlrVoG4vAkSIye8Pf+6PFrhfEBOcHlO0+TT04qmgVeZ7hzjkbVtv/LsJhbPJ00ZRrWCY5g2J9Ao19sAO4T8QQ/707p8q7uJ8Dorh0wMW7iONGngPA5iTmOf+6m/+pwJkREmLCC1Pz+ODZaLPORyMd8NFao9JCSlVmaNjsftP4cAEPBuCIpGCn/nEy8/ZRC8267z9Hxj+/Ge6fevBa+/++LC1m5bgAJ7dEqOXmI1LtDjwQIQ/vLZkObacK4lc71dpKCVqaghuU4Rxv2tUxHqXlcrupsn1Z9XF3Bc/6SUjwdbEVzKsOn9LlLM0EZVgz7TaSN13v/Q== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26e77bb9-6d64-4f59-20e8-08d8429258de X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7157.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2020 09:45:59.8746 (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: FK23efdOMPqZJzlumdPNo/RoB6ep96IjSKBYkEx+k2VlbuE/2Wzr4HifqsN9PlhYoimq/qNaIQFPEnOmdDjZJw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7160 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 Mon Aug 17 09:44: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: 11717835 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 6D601109B for ; Mon, 17 Aug 2020 09:46:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 55B8D20738 for ; Mon, 17 Aug 2020 09:46:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="mEEbQzIH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726858AbgHQJqq (ORCPT ); Mon, 17 Aug 2020 05:46:46 -0400 Received: from mail-am6eur05on2050.outbound.protection.outlook.com ([40.107.22.50]:21473 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726424AbgHQJqm (ORCPT ); Mon, 17 Aug 2020 05:46:42 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EjdFpegxMBKk4m9RostACyAypNqtSL7RLi7xOcWjD1Y2pXvyp8HVGGs2h0mtF/H6PKe7ERUdNSMk1aDSUtmBkfVxhhYT6jPHKa7e22sHAATQV0Zwc3VDXk1ISN8wI8ywGkHKVrLeiiPuIv9hnUOVi+Q6DuI3drpqtb/bVMFoubNgHeJYix3K1lsC9AolKvn8iNWsTLpJzB6m3lgZsScOLoZ3jDWtLVdLqMC5aUjtnNTjNkYmjyFCVNgZXkPlLmmmmqrVqoNPFoBbVcO9sdXhU2lFECAq2dfyDIu/mJI+e8mx2x7RYcSBL5npEJ8fraC4/Q+vZnIGoWj6FS5B48Lcfg== 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=PgcZaYgbuwiFbGdaBEIDLaAnrZSORHj5FtQlfngPczQ=; b=C+T14CBUZ8BxCx526bkiAI1yUCnrNlLnIOT4az/tAMGIw9rAciO6axViwtNs6klV4ZzY5T+e9EAH6fiM2VK8GPv9oNlC75ABJicbbQYtWVycBCRvPJyZqpliCBOK7QPtjgBty56Er81VYOV8NR/Qp3vthou3HT5TPadRGEztLb0AAzyURqDGrbzYhHY2XW0DyH1W59BLbltw/tw0WU7htjvh8CtlJe599rG0emSG226uWyZJHlJFWdKMfDFNLV0rtDmTmPHC4p9tLjWS2LIBbMue3KFjTEUlXp7j6Nz9cZn+89rFQHALRliFilpVAv+NcUHbTk8Mf+6NWP4PuY26xA== 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=PgcZaYgbuwiFbGdaBEIDLaAnrZSORHj5FtQlfngPczQ=; b=mEEbQzIHKtVgHW9law60UVn73hrqOEAk3lfc5Es11jCgfYx86D59TZgZXhvkct0Zfmf2nxChEMQBXcVp5dgluxjPj3l8+kdM8TSEzLaPYTyum2pGAb4ZE+K49RCK+8zCj5quMX/dl+cyT61mmC8di5NR1GqaMdHt+97wB6X22EU= 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 AM7PR04MB7160.eurprd04.prod.outlook.com (2603:10a6:20b:119::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.26; Mon, 17 Aug 2020 09:46:02 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1023:be8d:40c:efe1]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1023:be8d:40c:efe1%3]) with mapi id 15.20.3283.028; Mon, 17 Aug 2020 09:46:02 +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: [PATCH v2 5/7] usb: host: xhci-plat: add wakeup entry at sysfs Date: Mon, 17 Aug 2020 17:44:38 +0800 Message-Id: <20200817094440.23202-6-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817094440.23202-1-peter.chen@nxp.com> References: <20200817094440.23202-1-peter.chen@nxp.com> X-ClientProxiedBy: SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) 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 SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16 via Frontend Transport; Mon, 17 Aug 2020 09:46:00 +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: e1f033fb-cb0f-496a-fd95-08d842925a2a X-MS-TrafficTypeDiagnostic: AM7PR04MB7160: 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-Microsoft-Antispam-Message-Info: 28dZFsL2tKYeVIWhfNIvn1pa1PSDElgRjNgG4wLaKwYuTSvMSWPArAQLIFiDukH0Z+NF3QzH1QOd9kXs+km6MwTbbPZquys09gdV5fPeXt9IvuwCjRZUDJm3BjA+obpAbxuyYEYz1xbcDDI3/Pw1OLNkA4XWZPy33jgddnL0+atE0XkOCCpCKy9qJUNvbTcC35itMQvPWkuLAKZQZ96dMLQEx2l39phsm63DbKQem90+hwusG1WrI3ahNtuAzzsn6ezqzyXS/UNw1gZRSbgshHfpzHLtx+O995ghmvtgJcFs2z+waW9RuN3b4WY5/aSR 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)(396003)(366004)(39860400002)(346002)(376002)(136003)(6506007)(6666004)(4326008)(66946007)(1076003)(2906002)(16526019)(5660300002)(4744005)(66476007)(52116002)(6512007)(6486002)(66556008)(26005)(186003)(478600001)(83380400001)(8676002)(2616005)(8936002)(956004)(44832011)(316002)(6916009)(36756003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: imH/dUSAGtxmzyXFQYOosdJc/iXazu/2sdXt5JLKET7WkmuJ/JjTyv1BejWTsMZ/cSfhyR6GMUA6Sea8NI4LxcECh7Dp9Stk2qeiVvW6j/hyYXhJ5gMjhlEQKbVs1Qwtf1jLHuF+a/AmcqGcFCLc5tJyDnvqYOO27r3SZSF6oqISZJJ+sJaOmORx6dtxszEQ+xvxLrgl5SHK06blwuk56iVPApQ6mWPyzIp/Rqwi+/F87xRVDOBzU3+uSIALxcqUyl0+JH5q45GDs5SkLhiFMjNQ3wsdC5ssnrDlNYivZOIr77f1lbiersbrfpfFv13zS+chu5joZaYSOOFAT6rT9IdPEgkYyJG7cujUAGX68tZzZ4sVwEfRRyupq0OOsZBELQzyU2H/r/NUOK39iipJamVYCSLR7EGhJ9s4Ay5d1yesOAzSWKC60Tl+yX0VEhVMB6ckhkvcRyVeZRQ8EvdpiGJoyqUAQHTCvNGse0Qj97qYkdIRnxk9Ea4QF/8cgkd+mpAYoj3elMBPkC6Pg8gWUbECh01/PGwNXvEQ66rk1+kuxhBxq6uUP06bhcbuMEpJNr5D5Z90USdQ2WK86T7fzHmF0Y+4YqnuupIWumyY81C+SQtDw37h17W4nnFhZRsaszhKzZuFJkc4SX59lHHfUA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1f033fb-cb0f-496a-fd95-08d842925a2a X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7157.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2020 09:46:02.1964 (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: ji7JCv3o1XY3pL7i+TMB+zgPkfSfv329V4szoSu3DfjqPnU/eyPx89T2lLNaEwC+QYzFESowIYp0lQyBgHnkUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7160 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org With this change, there will be a wakeup entry at /sys/../power/wakeup, and the user could use this entry to choose whether enable xhci wakeup features (wake up system from suspend) or not. Signed-off-by: Peter Chen Reviewed-by: Matthias Kaehlcke Tested-by: Matthias Kaehlcke --- 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..cfca6fc8947c 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_set_wakeup_capable(&pdev->dev, true); xhci->main_hcd = hcd; xhci->shared_hcd = __usb_create_hcd(driver, sysdev, &pdev->dev, From patchwork Mon Aug 17 09:44: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: 11717827 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 70205109B for ; Mon, 17 Aug 2020 09:46:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 57B6520738 for ; Mon, 17 Aug 2020 09:46:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="KEQnGnwQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726809AbgHQJqi (ORCPT ); Mon, 17 Aug 2020 05:46:38 -0400 Received: from mail-db8eur05on2086.outbound.protection.outlook.com ([40.107.20.86]:12129 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726424AbgHQJqH (ORCPT ); Mon, 17 Aug 2020 05:46:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZBnc7/mYN04Ak8lLNAu7U2t5/RQOCzYKJ89mbwZnlUDC1ujHFYIsXI+wH+Jy7PhFdJgEk/JCRFFGKnymrYobIu3TFYke7oDyRqORZTjc2mlbN1nTepElLhlhe2opFt1c4YqTjG+wN09jtelKxL3lqdVZQheFvjcrlh142oTYgi+bViZtk0t5xZwlq6HxW6rt9v7k+4DwTqmIvpYM1wrVb6QrdxmE21nmI+j8PzN1dEw2qzHQSmypW8OkCu4NMRozvMBfRy6kJR0EKMRLD3eImDi0K3PU3mxpSM6dt2VV/AdmF2bNejnd9M7yLkj1qjONoTXo3SEfwvb0g9rV4vU+8A== 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=Eu+CRXIpItZzkvXr4syAY+4Txxg2Cj+SazsRxUIgVg4=; b=ewV4q5hjxusj9F5+fCjNE/PrJkxBaKuCa2ph+Mw2dJIY9tzwhqO6PLQZHDHVu5EkXfZK011TBMaNZGB4oS13zuACnU8yqfVzghOaOfMvHjc7YqKyeZygFm75tVLqBhB0clhDoXAhGtKUW8k2DDejwv/lYpDoebrPGTZrL71duQ6zqUWM8NN1eaKVFZ7X9a2ayw7Od7UR3xHCYNl/tOOlzSZX7mYqvgWDonHw6WUCESqsldIIbar4gjcCaqzFF8Jf5/ua9iVr1QNhTVuNIl8lhhd36tAPuhVbrM9BIMzw5ULm2yvaXzVlQGL27XMsxAiCm0wAe1UDFUrjsMeEDZ18+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=Eu+CRXIpItZzkvXr4syAY+4Txxg2Cj+SazsRxUIgVg4=; b=KEQnGnwQGs6kMV42qPtxaJUIV4WRDGxfEcIWfCCps5h/5lWPZ+xf1dT3ZYsOeyx/q1qK+4T0YtFzHTenxECc2s8/Gcca2R0KVgOe9i2d2tfBOS2WT3bXrfrOW/I0iyGuwh1blSdLTU1UMNKBMGrYbehLexw+ZKAHz1DmhNPbWXg= 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 AM5PR0402MB2740.eurprd04.prod.outlook.com (2603:10a6:203:9a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.15; Mon, 17 Aug 2020 09:46:04 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1023:be8d:40c:efe1]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1023:be8d:40c:efe1%3]) with mapi id 15.20.3283.028; Mon, 17 Aug 2020 09:46:04 +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: [PATCH v2 6/7] usb: host: xhci-plat: improve the comments for xhci_plat_suspend Date: Mon, 17 Aug 2020 17:44:39 +0800 Message-Id: <20200817094440.23202-7-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817094440.23202-1-peter.chen@nxp.com> References: <20200817094440.23202-1-peter.chen@nxp.com> X-ClientProxiedBy: SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) 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 SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16 via Frontend Transport; Mon, 17 Aug 2020 09:46:02 +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: 95d9e107-6ada-4bd1-babc-08d842925b8d X-MS-TrafficTypeDiagnostic: AM5PR0402MB2740: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: upy1S9j5FyWbvQRYPiNlZ79hXbLExEovbEI4/Vzpp2XSzpOwniRFRAucK3YGahyZLkyNjjHgBNzpPw7+bpQjl2clDrBcyUKb/LsW+eqibAicI4nV559WPOTA1xKgu9n0PQjLxWcdVB1aFopAeYWDvQ//0UgWVtMERQzBFxUZ4neNOdz42kRbwXgXJFDaDIHM7n/JOST+B3BKbRqctBi98dgCktNkiGr2M/Wk0zWxHWQIOzn6vMCxtitewGVVo7WcuPyJqTecmHGXCqXgFqH6kkWCfVto1vg+/pXyh3krtUK9lcWJKTcEaK9JtqMkRREEQaT4EPRn64kYiXzGYLYy4g== 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)(39860400002)(136003)(346002)(376002)(366004)(396003)(5660300002)(66476007)(4326008)(36756003)(2906002)(8936002)(6486002)(66556008)(4744005)(44832011)(83380400001)(6512007)(6916009)(66946007)(8676002)(316002)(6666004)(16526019)(186003)(26005)(52116002)(86362001)(2616005)(478600001)(1076003)(956004)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: vclUIZGo4O7DZHpwrkendIoEO/kF1chmHfzdepc7K/s0/mr+dpzMmn1mWF+raxbmmyEF1VpKDkBwWVTTQb2MMeStrn7+Rk8jzKhUXJ63cNE30tXlu4aM42H7MeYHnM4T4nGBrFWvi//UCgb93py0i+8upHEM405I+ulUPlWxIiW2sxV1ADy0Fs22a1e85Bm3fmd0X+QqGDuBPr7bN9p+nHBTLkHrqJow26P9rdpAOmLrLoP69WSE+nkWeoX68iJ1niORh+VYvSqG0JSpErIHw8I+s8JTChiSS0wGTKh13Km/RUjS81aM2Yk2g5MPSYkzhtqoqOkgiNuClN4hmI4DgP42B5OJ0TNrKAIU4IAjQz207y/wY6k+gZJi7LwG0psYvLQB1FrDGxeJliy9Y90ovBWSKHVkh32uE1/Sl2naEO47H7GfGvatS2c69s8LJhLsN18ck2htaVdDgpZU3FgcNpaeH1KeeO9hw6uLDKLsF1PJUh/je+JguWfVubrH09/YkcqQn9Qq3+Yg11iRRBB80Z/nBn9B4MB7YEjVtXCQOv1SUAtC6JpR5gz5vDfFapBJUgCLo+HVx8fsDJUl/YQzh/Q5maLVyuDc8oZ587xkFyMAlIkWl1R7YfEr8Nyi+clHTFglhpD3oGlI3Ix45l6oaw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95d9e107-6ada-4bd1-babc-08d842925b8d X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7157.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2020 09:46:04.5501 (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: ms4L0RMBtfbe0UNt3SB4rHRaIOCKAjNDHe6O6QPA8djmvEMVDxPTG3HnIhTGLgS0RNXZz7OWqWewQIIy/W34HQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0402MB2740 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 cfca6fc8947c..aa2d35f98200 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. */ return xhci_suspend(xhci, device_may_wakeup(dev)); } From patchwork Mon Aug 17 09:44: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: 11717833 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 C8183138C for ; Mon, 17 Aug 2020 09:46:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ADC48206C0 for ; Mon, 17 Aug 2020 09:46:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="WyRM16rI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726837AbgHQJqo (ORCPT ); Mon, 17 Aug 2020 05:46:44 -0400 Received: from mail-db8eur05on2086.outbound.protection.outlook.com ([40.107.20.86]:12129 "EHLO EUR05-DB8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726324AbgHQJqm (ORCPT ); Mon, 17 Aug 2020 05:46:42 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nwPcD3ceeygnjgqj+6agk0u9VGwGhZd6tCpOB+hwxV2s7ZVlGT6GbjxSG5L2sfp/1Dyeuv9L3LM/wyGzfiG6tYY2hJjQ1CGpv0nRMGNI/NCNigV8D9iZDMyeVNYp8UAb2vRzckHJSlBmkJWsL5XNB9hA+MU1Dahr+RFm3z+fOiq18bKjvuKgd11sKj8VvddbTD6m202p/5QB77TBKwms894QTMC6l0s0TwkS44lRmNcxWd672YniDTqDREmgTuDn7LgB1M+a3C3hIrwOkhJX6F8dlE1O22QVFbTNmn1uJ1jizPrtAelZ1Bip/H8PjwhXxoDm3V2BK9+6Tc4nKXYgCg== 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=EwB0us+Z8uRu7Gcc5O3cSg+XlqoHpxCS/9MbibIhHXqj8DTfw3bl87/E2gO378fnAU09oXT60L8ZmCXv0P1+PVbucFWPFdrUBUxijRTF4P0HKNJbMhIsJrLxivNkFTZWoPqxPfAvIsLTGcVBG4+Lj/bmPCzoMubDqGaWj+FIms4ov5VexMXs4IvaFDjk164OgsFwpXIqUVidTeMU3y0VpIDYbptSUTkWf/L8Zcu2KiJzjZx1iqKTaPkHNXPkn+OO8SQZoE9j4hAw0pi5gh6mfAvsQfkr9xTXy2nuaPT7OS/MNPVyah89ybbWGVJwMXeRYdxOlIG+FkGf5XcF2gSOTw== 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=WyRM16rIJAmnlURi77JJgTGSmz3VFCEgjQ4FyETG1rUb92mql+a1flBfTcsrJnFlRvoa3e+kWgmoqCEvL+FtZQ7zUdVPd5kBeu+OkURaVBHY4EylOi9YAjnlpUXOwovnNmxSFiyM6GlcbEnsHZFB/G+Rp1hPasx26Y+PKFPCNMo= 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 AM5PR0402MB2740.eurprd04.prod.outlook.com (2603:10a6:203:9a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.15; Mon, 17 Aug 2020 09:46:06 +0000 Received: from AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1023:be8d:40c:efe1]) by AM7PR04MB7157.eurprd04.prod.outlook.com ([fe80::1023:be8d:40c:efe1%3]) with mapi id 15.20.3283.028; Mon, 17 Aug 2020 09:46:06 +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: [PATCH v2 7/7] usb: host: xhci: avoid calling contineous two times for xhci_suspend Date: Mon, 17 Aug 2020 17:44:40 +0800 Message-Id: <20200817094440.23202-8-peter.chen@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200817094440.23202-1-peter.chen@nxp.com> References: <20200817094440.23202-1-peter.chen@nxp.com> X-ClientProxiedBy: SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) 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 SG2PR02CA0094.apcprd02.prod.outlook.com (2603:1096:4:90::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16 via Frontend Transport; Mon, 17 Aug 2020 09:46:04 +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: b9b8690a-291f-4e98-003d-08d842925cf7 X-MS-TrafficTypeDiagnostic: AM5PR0402MB2740: 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-Microsoft-Antispam-Message-Info: uzzAl9iN/2pTTjtfSVIzHDOqC0MAUGZJOPKI1MLRlY2seFaG+o2N5Ops4Fysi6aJw9Ynbtg0kTAWt9uzQyuAUT7Qvq+x11g0rLbBt/becxfgBkWfdi7WIHMQuSUXiZC5a3Lc9plgzfXLOV8bjlmVQwz+hDPsRuJ3tp6Q9xIPz6UqHt+Zi8G2Txt6oY0zmccl7sj7nI7wWuUDkG8KPqAQ1YmcwWbJvIEn0dfkmtR3UMD2W7UFL4gwdev6MGauNCmhCJ20on828m2bJPupWl4y6ohf0yxvDobrw9DYFNiSr58fJIj+ejv3vFaGjJFC/CR3 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)(39860400002)(136003)(346002)(376002)(366004)(396003)(5660300002)(66476007)(4326008)(36756003)(2906002)(8936002)(6486002)(66556008)(44832011)(83380400001)(6512007)(6916009)(66946007)(8676002)(316002)(6666004)(16526019)(186003)(26005)(52116002)(86362001)(2616005)(478600001)(1076003)(956004)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: /f2R6D0i0x5cVwd5dTDvzVmPK9bCot2urKki3P1eNyCvedcsZhgwhXv+j/Z5d8j7E98AivYxFkpm9/qwn1m1riXGpTnZNM2k1vqLS0woGSHTRZxctVQA2pRzkeqXVVNP10XsXKw1XgvH7UerQZAIuK21ne0rHDlZAEzcVpBuUtYRd8elfLiND/k15qjSaXKDcHm8dqVSHAWsvbU5t0iHjvWKFTQ+c9USXkvG3oS/qQgbP1UAEYz1fCXxhXhsGIjNJqGBZ8GS+JviVL5Xczubip1cu1G0PMIMONojBz0SbTICoEFEPs7bCOUt8RswI7aIYZiFs5D3Is3E5/bhuRtf9CZXjR0ntIX0Lg7Wqy59B7j+r7vKSuRxgPEDQHvEXxAoyNdXLYIciI4MJaQ1fXZUHbeQO252L8iJjntScsCqdubo2rOW4EMGT5DIx5PUygwHXxPolE4F62rCtFDstzXhvpi/J/fqJlZTiBnDpJFboxvE3HTyOEtgKBpnjGqByjueDTDdQGzaCH5k07fbasBFzGxdPwI3ZhkNVa/mRbFWh9OELlpOcSuu2Xsg+aQzMstUnnnNcXTPlA44t2G64mk+HvFhv3BSqr61WJkyEU/H43/IwuDnflbO/GoNdM2Z6C2SMLzzshjEPajEvVvmora4nw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9b8690a-291f-4e98-003d-08d842925cf7 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7157.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2020 09:46:06.7564 (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: m0Ts9ycZ43VZ47MVUjoVxjicgH9FvgsxRqISlXPMhQZr7iydAUmTm30A0PLkIicAwmWIJUzoADY+RAw0wp3Slw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0402MB2740 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);