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: 812478 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011068.outbound.protection.outlook.com [52.101.70.68]) (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 060C61741C7; Fri, 12 Jul 2024 15:40:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.68 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720798858; cv=fail; b=fy7ijR6C0EvFmilqlmxFYZ86wFiEH+YoQtl8WMlCL99D0g+EDYM/CEWSU7OSxjC6D1QOL834ay8DlMcd47if+3PSfg6JqW3ruj8qFHDpPKKjJvIpIv1mWuC0SfdB8lrdaRRI9dHXIchI4+ShxSoYhQzhBzokDfuNDmu0wNcQ/3k= 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.70.68 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: linux-usb@vger.kernel.org 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+NjFzLWudJeM6XTa28kmPLJql8wWqn2JhWai9sN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fYrXCasxjmhkneh6LJS6/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+Q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MIoSI8LeeGn0gbzmYIFK/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: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: 812477 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011068.outbound.protection.outlook.com [52.101.70.68]) (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 704D0175564; Fri, 12 Jul 2024 15:41:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.68 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720798862; cv=fail; b=ug35LZenioaKjs5EMYSfn5zTcFmZghgn0w21yQAG/pCWgkgGV3lLcO16IMr0xwOpFAChGNzMjoJFCCQNpu131CDbYZRDFwpxg6gg8L0t2164AOwsFyiT/q9CCH/KADaF1ssqhNHHWMq9KWG5Fkkr661BT+4uFyn447p0WnYb8eE= 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.70.68 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: linux-usb@vger.kernel.org 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/+xjc8m5?= =?utf-8?q?2TEZpdyrsVeSavcg4xSE19Oe8a86IOOtOna7gdeihqq+7qK+9WPWqhxiMal6aEDwc?= =?utf-8?q?Q0wXDdCQZ3PH/MWy4yOnl51M2duQ9szngS2n6Xg9KYSHeYd0cpxJe1t14dgIUoEWs?= =?utf-8?q?QUVGmg9NzuxdXNi4//+Wb8j006MewVpD8NQseP439jE59y9dILMZEDL5pENR6uanq?= =?utf-8?q?vHSgluSWcpszQL4I6fAvcwxVApI6JVwEqaYaisZlSsZL4HybZI8vreBTh2OqnmDip?= =?utf-8?q?R89APwNzHbz/MUR+emfFSao6Q07lRlX6oA5UNbfWgukIOxeiLOFDqp95YRm1aXiUW?= =?utf-8?q?Xnfn2CosPYmGURSeNalEAdAUucPCcIWp2X0dHW63iEj2KwuCh+/6sOR4TYPSRgfbm?= =?utf-8?q?Q1+HzAPRTL/9UJHskFQqPJ4vDaUPn0wlbJ0oT77U4ecsiDxe/luNoAF3DE6alaIgW?= =?utf-8?q?BGmPGdP28NT9WmdjKREIbKoEBgzh0NhMJBauHBmwaBLASIDbauGeMiPt6Qunvfxnl?= =?utf-8?q?RWUa4bI+zXOPKDt4pZsCYGmb5yIG84tHPq8rX6+OxWd1ykx9xo0DGOXCbQuBvm6Jj?= =?utf-8?q?DfnDB1QSFWelRrRpilwAra8qXxw/+BWkBNMNzNrV5n4DX5+gt+GoFHEtw4aFXCCg/?= =?utf-8?q?JM1lLM/ntxqtN/dmlvQTncqErGPCpsKobKHsRnc8RYLIaYu0G2CHSrjZORGs701rs?= =?utf-8?q?0GDRt0vSWV0wImprFHSZvuHcbqTNxgCZFMJC+s97o4sJgzqx1pWe4fhBuj0c/mtVs?= =?utf-8?q?Pfqg//dNjtgJQ+BozUHtl5qFNDF9q3BmE4ZhnZNDXNTp/uVyfSz+RZDgCeDOftQGt?= =?utf-8?q?OoxUvY2Kr7S2NS6GRCkeE+Y8JQUx3dUtwyjw3h/NA7GUUsDUVFVfioHFgZXZXj4Ni?= =?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?8y6EO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lSuPU/OSG9SUIAaZBCQOpDKVW8+4oOj7F4v4IYDkELiVfM9D5RtFOi4bt2PVVR6J?= =?utf-8?q?0XyvFZwU9ZVnQIuitb/Uf/ECFMgEI+spAQNXQXDvEHA9qi/cTAyphC9tWKvh8mqiW?= =?utf-8?q?yCilG/oOjiilsySb9/oOHL967cCGUYk/fGCaVl20FkPLwqrIVolPcMm4YesFqDSes?= =?utf-8?q?S/h21hSOen3W8h0BBM9xNHooST4Kjo9Rm/ngF1vdjfBbEjtOG6PPogFpbabCt7gDz?= =?utf-8?q?6LERoLhFDZTl92AYBeTaEmV8Agre294J7SuOfk/vrUeXVJi2jfAR8/yjPXrSTd563?= =?utf-8?q?CG3Bo62Nht891LuJVVFB3ohXr7n6NfFJTdYa9pOAYmqFSWDUFs6E8tdN4uYotAqis?= =?utf-8?q?cJ1tK7hz7iaBEJwi4rI0V9HCZ4gemxsQD9PN6oM8UbDnJhiPvhqga+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;