From patchwork Fri Jul 12 15:40:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13731894 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012050.outbound.protection.outlook.com [52.101.66.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 610C41741E0 for ; Fri, 12 Jul 2024 15:40:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720798858; cv=fail; b=fw23RtFZoUuSo/quFL6D7EixeXbt0LWlUEsL80qw1fbAa9HcajvpHHc2V0s18K9r80ZDVAyyOkOScTUz7HIFGo8IwhRNLmmPmWRSeuY6HqY3D8Af5FFE6FtUncvdktXLAufKqwJP1XKSETF52wUdjW1MlXrsFDxQQREpaszYNcI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720798858; c=relaxed/simple; bh=OPMEgo/PPVAH3sDsMsvf6tFyCZJh0Wh9SpXjFlyjVQQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=TN7E7GfitDtjS6MIg90OtWN2A3DzfV5iZgwzYvCMiPxQnKdrhw0r7pkk3IaLcWNRS/hwZaV4I4hacSwj44DnqkKi5Tcr8+BJhJpXV7jYGvyC/hTu+GCk9vlrFKa72uDpanSVPoqvE3SKRKKu+9LA3Gz3LgvQ0jxBiG1uITnkONo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=RKHh1nqM; arc=fail smtp.client-ip=52.101.66.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="RKHh1nqM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=to1FKDS5KTJDs3gxeR5/zcwzbcuUV8vYVxz0bcFVFrji3kxn6Pkm5vr0dqZxh0oIkEEsaymDgbzQhCGYbDKhI9lvBgtlA5lpJlhxTnNabteBoXhE9GA7ZyrYnF5bgVviIk2mA0IqneGhMEsTv2l/fXc19XpMN1hZxB71LEkoWH586IhlkP+gnoxZOuI23p60YE8jxvopNMXz7BWX2qhREFJGgHicxrE6yQzbhTa1RlpExZUTFLs1LBUGgAPfKev73APH+la+f9a1DPQVRtjUt5+odVH5MzSXQx3x15oQH7Nz8OVj8FwZIkKzuoF9XLKqBeCVOCi7Nr34+v0FAeulrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5FGgaU9IlyBHq49XF9k5+aS5ZI1cv/6PvMPvqC36+xQ=; b=XA0jKdaOOhdNA/IooFFmpBBXG0M2/69AeZEotKUKLKMSpmlxI/8BMivG0ogIoGXnLCZ2oCXxORtsdob85sVIKXimZqfsHA6ejBxjxwg+Tv7EjJotslZ4EKdl46j9iOXQqSxyeXzm6cXH6lbxaVcOPzt9F4mQd98BmLYbAz85N/5tnALrYTRrGZ8dB1ghwa20iUoq1o3HKuBO7fGDZGwI/HKIYquZxL3TOzVZhzaX271xRCAF5M6HQC42wGH2VZtCH/jHjSVMftU51t0HC6B23uLIWj7CWE6M4E5Fo2cNXeUNE9bwMCWwbJ8WDgZMPuL0MgmRghW6fgJLpJoCHVEqLw== 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=5FGgaU9IlyBHq49XF9k5+aS5ZI1cv/6PvMPvqC36+xQ=; b=RKHh1nqM5se5d0jTzhvlheP7nJOnnVYLzKhODUyeR1rENIR3ldQ4MRcIhn4RKKbiGrtvO3iuSMkJK04NhTvk6432CWwfTl+UzzfI9ASv33UyVVTj4Ni/jyAfbypq78wkHmP3bQ3bcwPDiMQy/05VRZ6o6+uqHNMq+x36vGABiHo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by GVXPR04MB9803.eurprd04.prod.outlook.com (2603:10a6:150:111::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Fri, 12 Jul 2024 15:40:52 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7762.020; Fri, 12 Jul 2024 15:40:52 +0000 From: Frank Li Date: Fri, 12 Jul 2024 11:40:27 -0400 Subject: [PATCH 1/4] usb: host: xhci-plat: Parse xhci-missing_cas_quirk and apply quirk Message-Id: <20240712-dwc-mp-v1-1-295e5c4e3ec9@nxp.com> References: <20240712-dwc-mp-v1-0-295e5c4e3ec9@nxp.com> In-Reply-To: <20240712-dwc-mp-v1-0-295e5c4e3ec9@nxp.com> To: Mathias Nyman , Greg Kroah-Hartman , Thinh Nguyen , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, jun.li@nxp.com, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1720798845; l=1035; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=OPMEgo/PPVAH3sDsMsvf6tFyCZJh0Wh9SpXjFlyjVQQ=; b=79kQ5gU3I2Wiqp8CjL+FmnXYIuNnY9o/3nwzGtu3pavtkPJTO8rBSBzRnWEa3bk5RbM33/nKp 9VDJBUZqjxUDZ9tmKV5LNKVDZRERRTlEU3k/lx5nNMXQ2XjdYmvPtxl X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0075.namprd13.prod.outlook.com (2603:10b6:a03:2c4::20) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|GVXPR04MB9803:EE_ X-MS-Office365-Filtering-Correlation-Id: 250b3e2b-b990-4c24-a2f7-08dca28902db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?dYE9626HuqSjfNtbRosvTiltsSWMXoK?= =?utf-8?q?OE7ll2A/CVpkn+Pguxvq88svUadl3eg0nZOOntZmwMXOwyvvbX+Fjdt5a1GbHwtSn?= =?utf-8?q?SAD78K+NjFzLWudJeM6XTa28kmPLJql8wWqn2JhWai9sNHBlOEj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xjmhkneh6LJS6/xn?= =?utf-8?q?HyXSO85B9aFVf7o2k2Cl5kFVNfA1uRI+jwBv9xbDpoQDiV9qOusYT/owIuWA4H7yX?= =?utf-8?q?Qdya7xOyCbP1iczBDnKnrciIDK8v/okO/FqsZEJnh3IuIZdHDX69Z2z7O1Us27rjL?= =?utf-8?q?X0FCa1FcI1xgoofQ5CMp5Flyl3zboyTv2oMDv/KABdi3jS5RR67cAePaJ7Fsg+HIK?= =?utf-8?q?bBrFXPrq7yQB5lHMI/3OgAuBSYLz6Z2eiCN/hoZljncxfVItYFHTvW6S8bPNT+A4F?= =?utf-8?q?FShISzPwVVHbajzgFRRPf4YbPx1uXZ7q2UpQNsy+l+zEHE3BK3kl5AEugdA3Bv0bx?= =?utf-8?q?UJMPrV884EXsI1v0cCoq4GlVYFQZ6QR6HA=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?5uaPYbAq5QDHk7y6Qex7Th9d+8Zf?= =?utf-8?q?emHfcqXDvHwH+l6c/4Wgny95Kicu88ucp04Yy/APE+F6k2c6/EAZEW+n7nxUgO2Wy?= =?utf-8?q?Aahy9nf3jKrqUQINZygN5xwDe4UKHc00jmgsm9iviA/HHd5un1q24xuvi1FUJgrfH?= =?utf-8?q?VXlXkQmL1u2JXm1ALwWU2qzeOuC8yicWESHzg8/dMYGmsBW/FAkPdYg5JosmwXYx5?= =?utf-8?q?FU7kXMaxUKrfMg4bLxAnFqutZ3lW6ATlyFhPeDrr/o8RcRvNQreNOw0O9rJIUO1yG?= =?utf-8?q?WM6JBjc+Jgxv5bKw5QjIM8+QccSlrt/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LeeGn0gbzmYIFK/Yv0ky4bsaBpZAHP8?= =?utf-8?q?Vsiupg+Dr1Zlq4MFYD/xX5KP/C+TlqeRMwO+H86SNGvFeln7AiCF4DWeEhf+V1PLV?= =?utf-8?q?8oxLfRZEy2gtxiaSoU8cxAMR3D+OB4nhOVrBgfzXwc0l7qcZdahjUaNbttCx8hBqx?= =?utf-8?q?5GbRUlegAWHLrc0rnVkaj3zZQiOvEhmGKaIaMxJyGf8emNMznfcH5eTlrnI0rKJvr?= =?utf-8?q?QBWD14Q7E2eCGXRD9PMp1zXJZYDhhm5PSt3oOMD7ledmhtOWXYrFsiTAkYwFCyTn7?= =?utf-8?q?5o1v+RXctfw18mCK9/Uk6lmgYki9pSWHcdUwAy/pu10JYqsXuvrRXg1zRIWYMlUX5?= =?utf-8?q?s6hUn78Ig0h9?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 250b3e2b-b990-4c24-a2f7-08dca28902db X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2024 15:40:52.2949 (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: 9kkJ7rmX6Q97+7fWvl6oByOXjPFh/vvmZRz90i4le3Z1NJOFdr9v2p5ftKK6fs6/XGm+7gtU8Pl765DaQjlucg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9803 Parse software managed property 'xhci-skip-phy-init-quirk' and 'xhci-skip-phy-init-quirk' to apply related quirk. It allows usb glue layer driver apply these quirk. Signed-off-by: Frank Li --- drivers/usb/host/xhci-plat.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 31bdfa52eeb25..ecaa75718e592 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -259,6 +259,12 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s if (device_property_read_bool(tmpdev, "write-64-hi-lo-quirk")) xhci->quirks |= XHCI_WRITE_64_HI_LO; + if (device_property_read_bool(tmpdev, "xhci-missing-cas-quirk")) + xhci->quirks |= XHCI_MISSING_CAS; + + if (device_property_read_bool(tmpdev, "xhci-skip-phy-init-quirk")) + xhci->quirks |= XHCI_SKIP_PHY_INIT; + device_property_read_u32(tmpdev, "imod-interval-ns", &xhci->imod_interval); } From patchwork Fri Jul 12 15:40:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13731895 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012050.outbound.protection.outlook.com [52.101.66.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D58D174ED4 for ; Fri, 12 Jul 2024 15:40:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720798860; cv=fail; b=c1TkgoSb3lx56TMsV2dGYxOw4V8xq+T5E0oquwFOGhn5Miu1MG3BRYrdCMbZSUShaO3AB8aVsuOoJCbh2V9zUiOuJbngBuXj2GpkWBy7DfsmbMck4sNhCBQkdO/ZwkbrnePy32KbMA/yxQviCwHTYvFvNzzoF5Q32bIMoObw974= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720798860; c=relaxed/simple; bh=SaIf7opiJAmqwuDjaWgawxfzMs2af1K+IOLeH2hYimQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=Hhfh39HMYS5bRkvq2KVg0RJTvaWifr4MniZIgdWmICg4fJWqAWJskkreZtCgH8hJpgfkU9vmJ65cavFlNs8cs83AJo1x1mWNmP9tlyOzbSXPdNTEdKVWRAplCV/0a8Jmb+bKRPRwR47Mo/YIBLwOZa3YyuEtCHPKErmsdwc9nB4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=lLQoJ0ji; arc=fail smtp.client-ip=52.101.66.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="lLQoJ0ji" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=q2QKoJKzUWiUy4hV/aY59PwvLM/lYQSj4gq2n/lczz2wezQQohwVIruXXhKrvQ1fQ6/kXA4jwbzj8Lcz2Fyljcqp/NzJj296v9WHfLYMSGwH8hoycg0wcRcqA2vI9ES3O43ylmm5BuZ4ycCKP2fm9Eze608pHHYTdwe+JynXLu1fJukq5C+/t8gzBCeIk0TrYNUO3alFfgHITx+GtNINlzTBrN1kcXIciDGV9OwXJJ+RZIwZSO1hAF/Txfr21yeM7cW+3R0knN3Z92sbUmogCOg8AHsMe2Gc7reMsSAFCp7ZU6+179rViVyrDiBgG32ZN6OaxPloIZAzu3mVEJdlJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=D98Q488QXdfIcWQyu4qXDVPKVoYkyj7k42xNKXurkNE=; b=n5X9Kfy2e39vpdZx/dQqF6ozYN/k8zGGE1CfA1abPweoE2K5eSFhsautzs7chYcfwHk+kVNvL9cgEw127Db1xmeBRnoRf2/Nm8ZiB0CXIZs85pM6rOFPJcXXPhsODK67jHY+SKwmCSYOqCubT2PjOXuuB5f3bYONw1Xmal5Yx3NW7IOs9vtlXnmy5Q6NzH2WXhOG3b80ZOmg4snGLOdwAi0RpHhvqqTtuoIAAaQTHNLdpiG16RIg9hQP9VgRIo/31nEM5lN0Mi+Mbycnmlb5+YiVV2Ly8FZdtJhZZWziQD8wv9eurKWwZYw46ltarbJJBNttedPbMzsWwXHSX3x8Dg== 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=D98Q488QXdfIcWQyu4qXDVPKVoYkyj7k42xNKXurkNE=; b=lLQoJ0jiAw+muC+GYjENIRkkXr4rDBCZLvLOnqBSbrjDC+B+sY1jIxcQzRvUl3Qy0fI+lya0BOUCywOWSMvus2k4Rco8F7x+69aG7787tTBWMhBqdZRwczkiTDwdrSWANb7ei6UydLJYGAynp+VZpzUns5jqdgjOR6W1Mlm6hwU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by GVXPR04MB9803.eurprd04.prod.outlook.com (2603:10a6:150:111::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Fri, 12 Jul 2024 15:40:55 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7762.020; Fri, 12 Jul 2024 15:40:55 +0000 From: Frank Li Date: Fri, 12 Jul 2024 11:40:28 -0400 Subject: [PATCH 2/4] usb: dwc3: imx8mp: add 2 software managed quirk properties for host mode Message-Id: <20240712-dwc-mp-v1-2-295e5c4e3ec9@nxp.com> References: <20240712-dwc-mp-v1-0-295e5c4e3ec9@nxp.com> In-Reply-To: <20240712-dwc-mp-v1-0-295e5c4e3ec9@nxp.com> To: Mathias Nyman , Greg Kroah-Hartman , Thinh Nguyen , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, jun.li@nxp.com, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1720798845; l=1434; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=SaIf7opiJAmqwuDjaWgawxfzMs2af1K+IOLeH2hYimQ=; b=XUIe+D14hdDTmZ+zis/snwDeLUqSU7Y9rxKU+o4r6ko0CpCmB/Jv6fn+yDkpUd0EblD5H6Vdk WZpzmK1905cBcYnf/lxuWHlOg5uZFQBIiPtXLrTmiUfXWQqiatFllmB X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0075.namprd13.prod.outlook.com (2603:10b6:a03:2c4::20) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|GVXPR04MB9803:EE_ X-MS-Office365-Filtering-Correlation-Id: b700ad6b-fc58-475d-2401-08dca28904d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?arOZoWzxG2qo7/hrEmUdajaXupmcNrC?= =?utf-8?q?HeDfUU/PlfbZCa9SQ4b3CH3aJnYm7LV+XuKeT7s+JAbt0am6qe2tU7Y/sWiFO/2ZM?= =?utf-8?q?TFRzvYZKxznGszhGpK2U+GFVD+46o0suQAP6QNSvPYf/SgABj0hZVNpEKIMFfyEiG?= =?utf-8?q?A0sZT2AeA0lNGiqr6JIb5y9CSzrh+kfrhLb5aUoIfiXGwiTJ45yj+vJVVsuNEokUU?= =?utf-8?q?t224iMNrrIv5wxtNgVJVLxSxjmgWcF9Oba7T5TnYxMkre1wzVvwD86fW+UjysIu+B?= =?utf-8?q?fj2j7ZUdrgA1CX02GzNFDN0qhEychkQ7TiNNjEuhIpkiZeTMT591m7LYMVuev+Ddm?= =?utf-8?q?hSbKhl0Ull5xrPyH7t7gkkBqpW3ERXDKWmhPGRGrEsrnGHEg9SyYRyHaWEt2Xl8j4?= =?utf-8?q?F2pIq5f97nR6mHf/nOFo9U16egCHj+I0g9ZOtUQIJ67B6vqaqx0mj4KZVtD8eh+Hk?= =?utf-8?q?aXK5be8qO4kArTY8h5+ACCjsawh+GDFuwxGk089txQYyS2t2cEOGZYd8xr3CamiZo?= =?utf-8?q?T4Ny1gL065gE3qI5pub47pngJAIhcrkVs/Omj5DMv+I9e9vsi7TE0IC4tsO0B07t5?= =?utf-8?q?FcGuPiCGcWfiBQStXZ/4rMwqAK9k7AJhZc+KxTBVeczUB9wPXIAW3ycabIeWT39U1?= =?utf-8?q?z5BUlNlK9tJyOIBC08bEbGGyctgg9MWfKNyd5nzvpfluhMuJBFCwzs0tp5alaURID?= =?utf-8?q?GBV/H+IzBIUTPNgJ30ViQdh2UFycHcrUV381Zs3EaSQPHA1RP+777DnCPnxQBZwRX?= =?utf-8?q?6V+LBoNdAUWFRjeaxyqZlyK7fj4LLZoW5p1ZtGryNJ1TTbQ8kzEWhcaOaOUaU23H5?= =?utf-8?q?r124OpM6aLYrHKje2svmRpBPwJLMPeUG/mhCHPBz4DWaTuumFoAslv7DwSp6uY1SF?= =?utf-8?q?jg1ZLeZnhe2rZ6wFOh3PgXHGqHXV8FcxGhBt1Ac892nDm1DHAN3wpSwj4vHB3/nxS?= =?utf-8?q?1ehTaiyULdq6IYHIVi7FesmNGwKzmFbAC97s2SAt79Rtq1k97lg/jUkSIevFfAwJ8?= =?utf-8?q?xC1nmnfWmlXCJlmUscbBqBthHD0KM2+4xkLo4TwmAo/7sIDV72lx1P1PZFlO/HQOX?= =?utf-8?q?p4bysl1gGDDEOu0xdjPT97m8dY1akxgwcIOadG03lcE83dF6XImjfCDteXFgGxtHr?= =?utf-8?q?N8OXaosf4BR5BKM0Zw1dGJ+xdz0pjykvP8HlSlvCrg+uOZyDb6smVyfj4QqRkOeC0?= =?utf-8?q?1khEvUFA5fj746L62hJXkUuAI1QBWr9Lupd9eKDKV1V/Lbb2jCcH0H+gKgTu7D+5t?= =?utf-8?q?PdW4ACvdPCXmEMIiYs8gWul3LDzUGYaXEmwx7rg/wwicxpCCV4FB4GeAc6g7/Lx37?= =?utf-8?q?BTdDfRYAHzAPKjmSxnnJgAbTx97owQPt3A=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?8uBWbrUv5kmCCIrz++bc/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I5mkJtTeyXrxa?= =?utf-8?q?YIk/O8b56mYEFs/5ZEQHcUj3n/tHvpt0OQoFTwv2/ZmHZUbe8a9Pt9k3bKaARpuO9?= =?utf-8?q?rvRFQ8qI0FjTcL7XlWc68uG1xQc1NXK5T38KlWW8PHX9L5CQGbRi2SCFlPolz0LCS?= =?utf-8?q?KAu3+Cj2OGSoCxnOyWYOEoGANr/DOrd99iDYIdPUEMyuf17FUVoCrF28wiQyyraMa?= =?utf-8?q?5fNyk7u4f72H450/c671OX31b8mdRsGS1RDT/DLJl31hLgvu3KVrPPBBBFbxPpz7m?= =?utf-8?q?E/psE2Ik7T54GwIO0afkjsrGhBcag3cWqP7rzB/++IvW5oX3unuQ39fWDZjLl4akc?= =?utf-8?q?yxL4nVSG3t1U+QC+TosHbfjUcq3mTfwIvNnoGeF0Ru1EPvlDCDJkssHqW82XzX9pn?= =?utf-8?q?l5/58FZC7QdPyDDmL5u6rHQpfcPKQbPrIfjpvTet3sWxo3NbSKQeBw3kiMG20jepS?= =?utf-8?q?ewG1sy7rOugbYdtehNeWoLT+KFvj6nlssrQPntKDdhfHp6QX5Kod2fS4bWag/82RV?= =?utf-8?q?KlqAq7nw5EpchyaiNhvMi/cJj7s1W4syUzk9f7YJFSKOC8nH8zbsSEL6qwkE+TKYn?= =?utf-8?q?aD8IXcEDDS9RjRPf4Ht2dh5V+ImOfRQnJ8J3CRcfROlo5+fPnUzgcXyFwLI3/PEnd?= =?utf-8?q?rkpat10HsyZA?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b700ad6b-fc58-475d-2401-08dca28904d1 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2024 15:40:55.6164 (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: GAfXYKQp8v7KexhFTrwNBS8GJCNuYWA2gTaM6Qd17RG0zkfauT2OxGk3SOV9PfgB5wYY08iZye27QsD7kcmk6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9803 Add 2 software manage quirk properites (xhci-missing-cas-quirk and xhci-skip-phy-init-quirk) for xhci host. Signed-off-by: Frank Li --- drivers/usb/dwc3/dwc3-imx8mp.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c index 8ee4480685031..5794bb75f7604 100644 --- a/drivers/usb/dwc3/dwc3-imx8mp.c +++ b/drivers/usb/dwc3/dwc3-imx8mp.c @@ -144,6 +144,17 @@ static irqreturn_t dwc3_imx8mp_interrupt(int irq, void *_dwc3_imx) return IRQ_HANDLED; } +static int dwc3_imx8mp_set_software_node(struct device *dev) +{ + struct property_entry props[3] = {}; + int prop_idx = 0; + + props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-missing-cas-quirk"); + props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-skip-phy-init-quirk"); + + return device_create_managed_software_node(dev, props, NULL); +} + static int dwc3_imx8mp_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -226,6 +237,13 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev) goto disable_rpm; } + err = dwc3_imx8mp_set_software_node(dev); + if (err) { + err = -ENODEV; + dev_err(dev, "failed to create software node\n"); + goto disable_rpm; + } + err = of_platform_populate(node, NULL, NULL, dev); if (err) { dev_err(&pdev->dev, "failed to create dwc3 core\n"); From patchwork Fri Jul 12 15:40:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13731896 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012050.outbound.protection.outlook.com [52.101.66.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7A7417557B for ; Fri, 12 Jul 2024 15:41:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720798862; cv=fail; b=PYLwWpSksNtV9S8EDryHYMyTIhtO1ZOk69YLvWvE/hIn/uLsD9eGdCSdoF4Iwh5+FP6MCLqymEevz6sGgvUocmF9jOr1P4IRLfq3cpn0k01sLw1tpLw7AvFbUyka0bTo4WvyAfLerMemx4dL5rZVktIZDSCtXTXpf5DBZb1uNqE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720798862; c=relaxed/simple; bh=LZF8fiRnNfUEj0/JG74LN2cwxbM6N8hCxC0T75KalPE=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=GmHE2jzCyDYl0TiJAIUPgxstA32yBm0osAjeZ245RIJTn7tN20iRQ4WPv7I+VLY9Jvklt/+p8nJbBjRH5Awq5YH1jZDc4ppv8Tm2nYcdSfEWTNyEIRbnj+dZXEh1teYvtEOgpyRcePznOVIyMXRiR9FgClMcuqD4+HW5KqwKgpE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=neKsav5K; arc=fail smtp.client-ip=52.101.66.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="neKsav5K" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BQtv4FBxdHlSmlxMzxuTav0ydzRDlYgUabr1ALzgBVVjeRYYJXzMk9H+6Ou+PTJFz04148iPVbZrNrGG3YTenzYupwedzBg/v8kj03SYvCy6rp3VAR80ihaqtaEeLREgbxX/s/qkaJ+8dWKf0T/77Yua+qkA/+EQDb9KzHaqO5gPE7u8QILINROBKQtu1fDNP/mI4FdQejbfhAgsmkdWfHCYotqqLzZx+TqTeWYouKbd2lJxOeYnx5oH7yLP2YPHfivxVSxlYPHtW+dt4RkYjJdKcJ+P9TSE8bKFVkEAWW3d9DnvZ1MxMYeWXBLPS3pMhjgAt4B44fUZtE7LrgzpTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZB2TN56YA6B2HFvGdRxxQfGotLFBN47dmzc4O7jlKXM=; b=cT8bC8Q/V7qpERFHYJ1Pwco3AD/3Ugr6J2rByXmGm0wTauQOK4qZlYac5Msk9DQdoso6oL+GzopqC4II5jE2maWs5szO9R6JuYwyAaU1HyaqrzSI+9G4fR0l4pCp262CKl4W2VzXngJXI3uIy0keacQk/Z/OwfR9UuZMOAGCNyNU5Yb/Qql3FAl9ceJEPDnINpD+33oywrk6YK0V0iXnUImNRGjyjbGsG8MuyGtThD9dZGA5SbW5rAAGXvv0z/ZHmVJ9oc5xQhXlplE1uVpBUk+jp9vDgTRnUd+pJmBxyQ0HD/HTl0nFpGghH/6gAYO6ymRHmKgNI/Z3SB+umOxtKw== 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=ZB2TN56YA6B2HFvGdRxxQfGotLFBN47dmzc4O7jlKXM=; b=neKsav5K4E109bgYqwhF+C4LhnrObcWzykcEbGCcPdkei6oSkDlLmuYKARnrQcoNvtovK8+CaoKucowyTCQvmJXxzH9taNdREObcn0F7jAHw/nI/GwAlFHkGV/yd7KaX4vSd2V1jiussJgwajm3nnKE2Kk14wzGCkgWRnR4t/9g= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by GVXPR04MB9803.eurprd04.prod.outlook.com (2603:10a6:150:111::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Fri, 12 Jul 2024 15:40:59 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7762.020; Fri, 12 Jul 2024 15:40:59 +0000 From: Frank Li Date: Fri, 12 Jul 2024 11:40:29 -0400 Subject: [PATCH 3/4] usb: dwc3: core: add a core init flag for device mode resume Message-Id: <20240712-dwc-mp-v1-3-295e5c4e3ec9@nxp.com> References: <20240712-dwc-mp-v1-0-295e5c4e3ec9@nxp.com> In-Reply-To: <20240712-dwc-mp-v1-0-295e5c4e3ec9@nxp.com> To: Mathias Nyman , Greg Kroah-Hartman , Thinh Nguyen , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, jun.li@nxp.com, Frank Li , Peter Chen X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1720798845; l=1856; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=HDrRGCYGDwol4RWWe1IyBNwBksEIqTK/O4gYUc10XcQ=; b=dTuD710yiij6BtutucldXRLgymp/G1IPzLfJEl9747mFaSdIBXCD5juypswY0CkHmDpGjI+cd BFjuQ43vp0eCqCvsHXr0PlTBDAiO76Vf5S8XA4VEhXNwRxjIi91kddW X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0075.namprd13.prod.outlook.com (2603:10b6:a03:2c4::20) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|GVXPR04MB9803:EE_ X-MS-Office365-Filtering-Correlation-Id: 914973b3-a8d5-4246-723d-08dca28906e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?8rpKCJkarO2IML1rZokarplT2ApKQ6D?= =?utf-8?q?AlUDKc3jKkm45vLHl70UHEnlrAiTLd9YySyFsSRASi7/+vYqx1USyt+EiwSkrVOW6?= =?utf-8?q?Syao/WsVQbaCCk8CoGgJQp3iFJKQlSxAIPJvoBvSqqv/ppcwYqHOYM7u58HLdQr1n?= =?utf-8?q?L7tbGJaJsBzYQifMoEiYGlf7Si0Rx6ba39pOm3QlqPu91/zxCqv1+LH0knmT96KJx?= =?utf-8?q?zweFQj11+a5yCdp8qFAu4yAMIkQpANIan8p99H6sPXq1wgKqYxGvEF5zD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= =?utf-8?q?sjDQ9kmp3mzspWiyrKkVgcnEzFOYNgpX2Gfwsjp+9Vp+nGHF7UUZayfBsdoMajZYQ?= =?utf-8?q?D5j6MxaSpqkT9FmqtdxrKBE2YSaQ7kZ5B5cdZ6yB4TG+qMQuwDgPSp7cAUhns4Zdr?= =?utf-8?q?B93YRL8gfrAcrpy9Zdl1v0kvMVIr/ex6Y8sIAQ5luJZTOKXQULCy2noQCRwpa73Ls?= =?utf-8?q?hMWxjC3+iqDIewf5gEpucLTPIyU92O5LkA=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?64k20Pth3gVmfLuubRd9sqYWljNL?= =?utf-8?q?8y6EO6aDcMaBOoPijs35IVCDfKc+5M06LWuKENzYc539JkMUUudPrduQc9SNfy9vG?= =?utf-8?q?OBn2MOfWDrQgbLWn3GqhLCz/qUZXpkmL7UxVG9VeR8L/zECagP9o/oEEKBZIusjOu?= =?utf-8?q?KQs9t9GGHBNUSPYIC1F/OB6X6c0dcJg4S2+R6mYOVRENT7m5HCTTsfdIErI1AWGve?= =?utf-8?q?7HhohxgG2nmHIyLtpmW9xYeasQOXvsgCKLpM8IO2LIMcu+uPP9K5cRXQZ6Ykw8JtZ?= =?utf-8?q?RYn16yKv9gv6rQYq+d9PrfpHDeSXBAt15YyQedF00SARnxIEn2nvKaIFVRLj8tE/K?= =?utf-8?q?t4R+qlsjCORWvid8Sb3Es5mRiXwFnAB2Eg4Epi49j4aLhdpMjXyNP5DjPjuJ8+hGK?= =?utf-8?q?t4VfGcwv/LhFruaz9c1QHQ1QSjvPlH1TyGvLZI9S0x8c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Pvhqga+tuxzCnhS2mA?= =?utf-8?q?AsR98iAO58ptRyDT7e8CCUf4R1t8JZcAhlkn57OIubnsaExkrxUkXx3d47tc2FED5?= =?utf-8?q?aadF39piPm7XV1rAkhqE/yfWcAbl7niJC9bdLhcmvgAazV3RPiNv8PksikQJkldg/?= =?utf-8?q?W2gCZAolHqmAq8kXu8YSsCd5AKaOKoWKqQBB4yD08f0TmTBQrUwOJmrg=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 914973b3-a8d5-4246-723d-08dca28906e2 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2024 15:40:59.0460 (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: 3zYy44mx0Qf9/n/64Wmp3hCLlxSV8x7nOxlNs98Z9cmnNZbeG3rjat+5fZ0rFOMzDwS1FkwfdwsCzWXb/CutAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9803 From: Li Jun The runtime resume will happen before system resume if system wakeup by device mode wakeup event(e.g, VBUS). Add a flag to avoid init twice. Reviewed-by: Peter Chen Signed-off-by: Li Jun Signed-off-by: Frank Li --- drivers/usb/dwc3/core.c | 13 +++++++++++++ drivers/usb/dwc3/core.h | 1 + 2 files changed, 14 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 734de2a8bd212..d60917fad8c52 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -950,6 +950,8 @@ static void dwc3_core_exit(struct dwc3 *dwc) dwc3_phy_exit(dwc); dwc3_clk_disable(dwc); reset_control_assert(dwc->reset); + + dwc->core_inited = false; } static bool dwc3_core_is_valid(struct dwc3 *dwc) @@ -1446,6 +1448,8 @@ static int dwc3_core_init(struct dwc3 *dwc) dwc3_writel(dwc->regs, DWC3_LLUCTL, reg); } + dwc->core_inited = true; + return 0; err_power_off_phy: @@ -2375,6 +2379,15 @@ static int dwc3_resume_common(struct dwc3 *dwc, pm_message_t msg) switch (dwc->current_dr_role) { case DWC3_GCTL_PRTCAP_DEVICE: + /* + * system resume may come after runtime resume + * e.g. rpm suspend -> pm suspend -> wakeup + * -> rpm resume -> system resume, so if already + * runtime resumed, system resume should skip it. + */ + if (dwc->core_inited) + break; + ret = dwc3_core_init_for_resume(dwc); if (ret) return ret; diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 1e561fd8b86e2..8a4bfd9a25b19 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -1195,6 +1195,7 @@ struct dwc3 { struct clk *utmi_clk; struct clk *pipe_clk; + bool core_inited; struct reset_control *reset; struct usb_phy *usb2_phy; From patchwork Fri Jul 12 15:40:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13731897 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012015.outbound.protection.outlook.com [52.101.66.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3FC981741D4 for ; Fri, 12 Jul 2024 15:41:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720798868; cv=fail; b=Z5AolNcMlOUrO8E1xuVYv1posEquwaiQML1JhZVvahCFkDbcL+ewHduJQG96NlTaXg3NspvLYT04EBGhQ5+PnQLiP767EuN7h8CRusFJZ/o+wFlcUtDX59XkVXxdH/Q06w3G1Ih8m5lli/1mDY8FzGxDE/y69mCRh5ptslPRmmA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720798868; c=relaxed/simple; bh=KZVlfOTIefgB6kiTQwKkq6g+Kg893MkWvMwdF+odVUo=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=FTSPNCuIS8aZ7JVaVhP8IqWFqw7Ln9ksaIRF7NVBwYvxwGZzKtdXCxJSUwztV4Oef5DhopYdOlop+1ahf5n/8Bwpx5HaQ87WoDbRUremmS/a4cyd/xckOh15iwekTbqdaq0hr4HA04Tm0znyF9tsISyCwkFev7UKWl6ihmOUN2I= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=HIbO/uNk; arc=fail smtp.client-ip=52.101.66.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="HIbO/uNk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TWntMa057cvfi1L6BFtVHpxmL4y2us7uVUL6gLReCn+Mm0T/3N1UOoz053OEBNXzK0pkHVxv89yCFZ0/HAuzeoyl+s+QuRyYyRbIcc9Je6ViObYD3dKpZHPTO7Pie9+xnZVCKhcl1m7xNoO6bnjP3HUI5DMxR2qPBfQsejq53+jk5TWkmcF1KrW9iA+mJlrM/e7yN8I5Qr3m1rpG41k0kv704tCjTdXdkEqXw5BEYz2PeetoVZ/Cm6/aRjBmX4Fzp4DD2RIztjvIY2rUOc/tsgV5ZPWe9MyPTJjRSxYLXqxq9C0e6PZ5ZvCpLRhg4MQEv4as9GrF8i8EZ2wENF7Psg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=e03HWMjyVXsG8PkNe0yFHYiSkt4HxQVPGWPZkD0srTU=; b=jcSAU84lwbzSWK/C4ygNeNa+ADZI3JFS6gAyYk6wfn7wdenCLW5aWtAJLHEX5HMpAbKt3YdQwwqnaV5H/CsIZmCaT89d0OYzHcBOl/y+cKIfcKmoEKZ+KBNAJnRbjrXEBsDBR5tIOhDO/xlEJicswG9y1fa3wN2FyyOOUfpPj32JBljqAPlo01EB/ZMUYHAOfjNS0fjqE22S4MiVWUvKhZMQDOuimY0uGVG2K3whDNqyYiPJ82j5L0WPS39ElPklyli3V3EQHhDMZhmLQ1fLcNdr/wmx72mYtljJOllveiDx9tAvsHLGd6FV52I8VC8SEGFHHjdf8HgAlmMe2a+H3w== 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=e03HWMjyVXsG8PkNe0yFHYiSkt4HxQVPGWPZkD0srTU=; b=HIbO/uNk0qX6SsudA+f8d3ule37OC+nLmp6u68rqZzPPnxfenlXb+EibaFrIwmsJX+4+B0IZn8hT5vPv41xSJ29f5jaYi/e5BvDFlYbfNJzr7mGMkfK8EigEBxAUkJmDakdCwi37Vr59Bj+17fXguWZ6OkDwwr8o3Sqh1Z/aZlQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by GVXPR04MB9803.eurprd04.prod.outlook.com (2603:10a6:150:111::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Fri, 12 Jul 2024 15:41:03 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7762.020; Fri, 12 Jul 2024 15:41:02 +0000 From: Frank Li Date: Fri, 12 Jul 2024 11:40:30 -0400 Subject: [PATCH 4/4] usb: dwc3: imx8mp: disable SS_CON and U3 wakeup for system sleep Message-Id: <20240712-dwc-mp-v1-4-295e5c4e3ec9@nxp.com> References: <20240712-dwc-mp-v1-0-295e5c4e3ec9@nxp.com> In-Reply-To: <20240712-dwc-mp-v1-0-295e5c4e3ec9@nxp.com> To: Mathias Nyman , Greg Kroah-Hartman , Thinh Nguyen , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, jun.li@nxp.com, Frank Li , Xu Yang X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1720798845; l=2073; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=VbRag4/639rtFHwlkO1MlheNQd7FvEZ1sV+cuNpxmC4=; b=aXc6+SKCt/4bwS6Zek2nqH4bdndGgx9KXOmBz1W71z9gwBV6qag3PRIX/QItCzi2m9plPeidC 3+EXNN1SP0XCi8Gvt8xUt9ETK1Eu2ykXgJFvffpU6x0nUSd9TH+LqxF X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0075.namprd13.prod.outlook.com (2603:10b6:a03:2c4::20) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|GVXPR04MB9803:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f439cca-63cc-4e5c-2116-08dca2890920 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?/FXeWPC/GWfWU/kRhgVvJtiaVhB8MWx?= =?utf-8?q?xoYHgeWqOwbFwmdvVZmSd44xsmYsf3Le3UOYiKYrEtiWLcMh2D5rhdc4OHcDJ0DKv?= =?utf-8?q?clEidVRTE7pUsyNRSbMHxDMQ5Oia2WTiGPj4EdOkbfY3J3hukEfOTrm+oRCPP6D6x?= =?utf-8?q?pGZ5aSmxT8am1BuIlPlFSl8Gdxeb5d/VYVsknL7po+gQSJbMEfvsW6a0I2+juDSXL?= =?utf-8?q?jeqiAGEmEKtSVpSx/AORlCAi+20urTlH0AB8FvHyYQp5626X2Eiz3OKGCpaQOfwJv?= =?utf-8?q?uhFZnBqYp8DfSMBlKoqH9WbIFBkfuUcHx1gavLTlFMEfbiTGdXJmWXPp9kR7GyS2h?= =?utf-8?q?BAeAkrkWMnSWz3G8cFPeci/1EcYpUZk+8mCpbji5Qm7FhFWcnMYiZajoHiS6OtT89?= =?utf-8?q?qve1hK31f5W4ExIdTaSvN1vp91dxagFgxBs+xqZnGjucinpuUuQ710lwA0IqCCKMK?= =?utf-8?q?53NFfJucq9e2QZV3+FNOPaWLPPCQxs4sDezhGxxyS6kOehFeKdvmwv1F6QxMRF1Hj?= =?utf-8?q?Z1Tgb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L:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?3t/W4XmViLGNLD1Tc3G+TsEwGb/A?= =?utf-8?q?5FYc5b7jd8YLEb8G63kqC7T6LL7gkfwPhaL0gTCblDOUkgswhDfeIcLjgh3L7Vr10?= =?utf-8?q?umI9sFVXlN3cGq2ESMb3e6N9PlPFG1Q9diFMutWB5ghO+NYovu3aB7UuxWsfn6vaQ?= =?utf-8?q?Guxya3qFvmZb6Q2P8nHIqsglWCFKOXZbVQDldzTrVVKh52691/729XRY8QRsT1cv6?= =?utf-8?q?agRJEnts9NrbuAbl0QJz4Sg1bdRuxQUDWEToJQrMDTQ+aAtcUN0jAntCwquIxF/4/?= =?utf-8?q?WUcFqhmhlzsedrwHqHiDVDBD6CLdjvo7fEc+91XkrTDmCoDpoSrn/EG5WVEyk5bEl?= =?utf-8?q?SfmrFdfLV2tVecMyju/gVafXmedUcMAl2F7RUcbgbMqK/45HFBaaj+sZKykCdAjgx?= =?utf-8?q?5gUN5VrGqDcFFNBLvszq8RsmO1Y1g2tN+IxV09kjzkZH2BU33tLnuKOutieXYqkdo?= =?utf-8?q?Q1jmz0kf2EOzOukV5eGH/ocPkZEDTtpePyy75d7bPmDPmfO2lA19IkBhfWfF/d82V?= =?utf-8?q?8HmMi4dvMeJqK6BWLkpx0pRuOQm/RrrITno8IOgdJBdfZ5pSpVrd6kTMb+IquVivc?= =?utf-8?q?CUF9qguxMno4b9FAEG12SziaI3dLf7sidLyt4yZUEmAYCle3ixSo++yDztzFP9VFS?= =?utf-8?q?vGgCTOM80nfgQwebIVhonzS9elT2VYbrpXnDTKeA3wT8vRnJBh1mmjTGW1XZ+IgC8?= =?utf-8?q?68QOCkJB0Cz1eaC2jmo5PgMVnChW+z4u0LFkjXWoZpxxNOl+qF6AP7FJ690ZhiJPP?= =?utf-8?q?uqVqxaTrK9JyX4TP77THFy52lqcTbv5zrpLkS4HKqBievmhrpSwHCJ12xvjGfoxdT?= =?utf-8?q?pCrjVocUcnrhXZzMmNyatyr5uNGd027LeVmWqiso6aPlj1nN1CQoUa6GJWb8A9YeK?= =?utf-8?q?PhoGrH1f73fIzPxu+7Xydp8IJtKNLKTP7y2Enh5r+zBBIL6VZwNRZ6DIWqZdcl1mP?= =?utf-8?q?TwgoIy9x96KvfAjPUiAl4G5ahqUARrTIBQofz0K1d7xAQYgfDnzAtPfkPWIRVfVRC?= =?utf-8?q?50GXHNM3mW4HFpLOL0RyED/OCHOtUfbPxrTjP6SRTyhbm049lvqMhwbYkvg3YpL+h?= =?utf-8?q?GdsiPXwAIF+eJl7/bTLmLgQp+qAxz28lank7ANlz0T9PS7cecyx3fXJAB7AHBc682?= =?utf-8?q?/fq3wshGoYjVKbssR2uWoiZBiUIljjeS0Z0PUPMK6gcOKHIpMJ+HwDhON7yqUNtPT?= =?utf-8?q?VN7X+lKKA5ETFb+bvzFLm8l/HbBGXSL+6iG73/CIi61JbIHOOFJCXO8YGRO8xOlZT?= =?utf-8?q?2FPak328UKtlTK6+wzCJOavP9T9EtD6Dq83hDXRK4uV9UtLPiPAzXX/pnviSWINyx?= =?utf-8?q?6jKHDscfoX6nV/+u6Tc81bMpDXS6heQmAkehvvXO0vTZA7N7biO9c8yoj+Ea2Gvnv?= =?utf-8?q?31IIZAtoTVexADcbY5K/F3YvvdV55x0LoB8jPMf7xp2shpaTt4QI5bsh29QKo5jbu?= =?utf-8?q?3QBw7n2hj50mVQ+bd6znXJZYp3vc+zALuAtVuEm659cg3Fy3rUeYVv8E=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f439cca-63cc-4e5c-2116-08dca2890920 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2024 15:41:02.8011 (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: OXpT3S7RNDPMPwxtYFX0CeAB6gAO/hL+m1lZ2mmDn4ck+H7QJrIcpHMu+Cg9Cq2aKnKmGsK/5VuTCV5MT890oA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9803 From: Li Jun SS_CON and U3 wakeup need 'ref_clk' on. iMX8MP turn off it while system sleep, So disable these wakeup source and only enable DP/DM wakeup source for host mode. Reviewed-by: Xu Yang Signed-off-by: Li Jun Signed-off-by: Frank Li Acked-by: Thinh Nguyen --- drivers/usb/dwc3/dwc3-imx8mp.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c index 5794bb75f7604..9f8c34d09a8e9 100644 --- a/drivers/usb/dwc3/dwc3-imx8mp.c +++ b/drivers/usb/dwc3/dwc3-imx8mp.c @@ -96,7 +96,8 @@ static void imx8mp_configure_glue(struct dwc3_imx8mp *dwc3_imx) writel(value, dwc3_imx->glue_base + USB_CTRL1); } -static void dwc3_imx8mp_wakeup_enable(struct dwc3_imx8mp *dwc3_imx) +static void dwc3_imx8mp_wakeup_enable(struct dwc3_imx8mp *dwc3_imx, + pm_message_t msg) { struct dwc3 *dwc3 = platform_get_drvdata(dwc3_imx->dwc3); u32 val; @@ -106,12 +107,14 @@ static void dwc3_imx8mp_wakeup_enable(struct dwc3_imx8mp *dwc3_imx) val = readl(dwc3_imx->hsio_blk_base + USB_WAKEUP_CTRL); - if ((dwc3->current_dr_role == DWC3_GCTL_PRTCAP_HOST) && dwc3->xhci) - val |= USB_WAKEUP_EN | USB_WAKEUP_SS_CONN | - USB_WAKEUP_U3_EN | USB_WAKEUP_DPDM_EN; - else if (dwc3->current_dr_role == DWC3_GCTL_PRTCAP_DEVICE) + if ((dwc3->current_dr_role == DWC3_GCTL_PRTCAP_HOST) && dwc3->xhci) { + val |= USB_WAKEUP_EN | USB_WAKEUP_DPDM_EN; + if (PMSG_IS_AUTO(msg)) + val |= USB_WAKEUP_SS_CONN | USB_WAKEUP_U3_EN; + } else { val |= USB_WAKEUP_EN | USB_WAKEUP_VBUS_EN | USB_WAKEUP_VBUS_SRC_SESS_VAL; + } writel(val, dwc3_imx->hsio_blk_base + USB_WAKEUP_CTRL); } @@ -308,7 +311,7 @@ static int __maybe_unused dwc3_imx8mp_suspend(struct dwc3_imx8mp *dwc3_imx, /* Wakeup enable */ if (PMSG_IS_AUTO(msg) || device_may_wakeup(dwc3_imx->dev)) - dwc3_imx8mp_wakeup_enable(dwc3_imx); + dwc3_imx8mp_wakeup_enable(dwc3_imx, msg); dwc3_imx->pm_suspended = true;