From patchwork Fri Sep 6 16:30:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 826238 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011014.outbound.protection.outlook.com [52.101.65.14]) (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 E89F11D47B7; Fri, 6 Sep 2024 16:31:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.14 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725640263; cv=fail; b=mG9KvBpiyCgpGJ506fYT2XTy84ItQ4ELiBk/z3Mqc96vNA9uiYWfZSUYsRLAgjF2apeWSJpL0heu04uP3q60xWIPUNxRXk11l4JEA/geTivW68AbwNP2nukYs+yKifBtizYSJ7a8fR6oUksad1dw6ojGhTu7Ri84N8xWjkMNmYo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725640263; c=relaxed/simple; bh=OqCbEUzuE4T3rIePR+tm5vsCVk9EgAOhr0RnQgNI8YA=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=m8bkUMuqo+5GOLuUTc388GrSALiy27d274mOiztv8eabGFJYLms4e8No4MMowBJSt5WufhmirERJv/2/DNJFFy7YrHMVvke0bd/nCEv9EabbOq2e+LMlE+wAWWcicdpKVIGdd+b4n42NfKGCUIZHnIHmkmoaLmyCWwWHDWxrYlE= 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=Th7jbDG5; arc=fail smtp.client-ip=52.101.65.14 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 (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="Th7jbDG5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=O1pMgC+YcZ5EW6g8U6kpo1sDLiOww5dIjm3LMVFCBjANWwfdRKrKJj6KGSAYOWlOUOOwVaD37N+MaXbtoYWPU7dfoJkDAboIej/tuBpJn4H/f/N9TMVymoNUIoJBeZDY8KAFUiRPbI9FcX9Yj+lhQnzhNHaDwCzZPaGQB3CYbBNCGvfqp+KqUJSk66QPa5HCkZO1IGnyOK9KSThenQiGXe4iePwEKUJvpd1rCCpDLFNs7pjSh6yWFlVyQCJoEah76+tJ5alcPvAEwncmND08hHYb14S31tTxglcPZn98IpsxTqIwDryu//6iRIlC9JJye8RNbVHvgOg6RaGzD6QvoQ== 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=P1k2OidQaHAXcsu5LAg151l4XuFwaAcxreDyaPLNuRA=; b=O78m+7WuYy4/uwva/RXTIgATt5yutH/8SVWSHCEwyIg5jSVNxDh9KDYU635YRGbBV6Q3Zl7wILDcq8zh/hhgJltAZ4XjTBBnlrAS0UsU9PlQtAHD0yIa9zAGuXSz4eAhePhLaFbnR2Ya+i0aLEtA5dwta4zm/6q7ClxMOXSxTO1T3R0ydmeCnEZpZ14FdB3djsNKBqSOj4cKdHPzwy79lzSsBtUsfLdCQ1+V1IV6CnSKmppih+qLXFbTkSco3cgnvT3RUYbsEG7fdsbAfhR1yhm5bQXBB6TS2b64Q9Pqm8xiX7fwl0HP7RVFLIs7S935oetV8j4S5tXwQJPqziaGJg== 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=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P1k2OidQaHAXcsu5LAg151l4XuFwaAcxreDyaPLNuRA=; b=Th7jbDG5AzrBcoEqDhDm6GX5ad8cvup8g6sBINVI1a4sM4Ijfk4UIDrkPATpOYAL/3PDcT9/Ot61ztdPcuMlnas+X4FVcMX+5GpbLJ8vvOEexCX5EiiqxY2BU0gFRVCOgBnFUqi1mxmJlkTor6STvVSZzYL9pIjnxcvkIdyHDhs8U8blAX0uPzLbmqTdqP39uy1kwOfWC8XISTD7hdbKVPIDfPl0tUvdGqt2trnku3P5TtwRKqT+c3y6kBp4Uuu95wHeDbtdiWTX6fnWeFgE5S/E1/jYZKFIXUytmk9c/C4aGEVqOi/i7L8zM4lrh58t+jr6ELWRR77OZItdjB2wyg== 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 PAXPR04MB8405.eurprd04.prod.outlook.com (2603:10a6:102:1c2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.17; Fri, 6 Sep 2024 16:30:58 +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.7939.017; Fri, 6 Sep 2024 16:30:58 +0000 From: Frank Li Date: Fri, 06 Sep 2024 12:30:38 -0400 Subject: [PATCH v5 2/3] usb: dwc3: imx8mp: add 2 software managed quirk properties for host mode Message-Id: <20240906-dwc-mp-v5-2-ea8ec6774e7b@nxp.com> References: <20240906-dwc-mp-v5-0-ea8ec6774e7b@nxp.com> In-Reply-To: <20240906-dwc-mp-v5-0-ea8ec6774e7b@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=1725640246; l=1944; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=OqCbEUzuE4T3rIePR+tm5vsCVk9EgAOhr0RnQgNI8YA=; b=/UYymoHjkfEXSwUAe+RXX8a+NNWppPVHgmvE6TAXrbKIm2xqTkIejh2UyPOXpaAfqNdGVKyWZ uAYzf6P+lhFBybZJIgQQdT4qaGcA3aEpjRMCMEO+lDB7hPA6dI3s+3u X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY3PR10CA0016.namprd10.prod.outlook.com (2603:10b6:a03:255::21) 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_|PAXPR04MB8405:EE_ X-MS-Office365-Filtering-Correlation-Id: c339bb61-14a5-4cfd-9d80-08dcce914984 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|7416014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?cy+91VVRbs0lcSiVcy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jZ6NuhRcxKDHAGO2H2UaOz?= =?utf-8?q?QyQU3o8P/+DguJuVQxGwHKlnvhD5VcEPH+d9IN5ONkP72n7dvnK6ndPyHd13szx1+?= =?utf-8?q?OOMWC1VOnzeWIqItS/9/H8mtlVjVTgGWrc5lAAqS0+XAKJvffsQX+bMwEGwHUBlrf?= =?utf-8?q?sdKd/akckOBJ0WIn25Yi4kA6y1ygfQgCn+g3rg+hZESc0uCtIc6ST4XCujE4+eBnn?= =?utf-8?q?ib/SvUYfihbSgH5EyV2s6g6kuDAisdNDWN9GsDLFMqxGLfqG4S469f/OeMojfCmK5?= =?utf-8?q?11fXhnWi1w+yOBB+w/LusOMzr4WxS0FMGVx5sT40qg8hFu96eSjd8j+62HXsywR4w?= =?utf-8?q?zVvFiJR5z2mGPMmv/8riM4dMxqwLya/PwWFZShsZDsqIYTn0WvxQ6oNfpC1RpvPMK?= =?utf-8?q?9I1DvyUPfTIf7CbgpUibizMAboKE6T1oMj7ltaOivGnKpbCNh7WljRkp5zZUX7Dlo?= =?utf-8?q?DuQUlAk6+OAHxTuJmRSm1/XQWheuTvItMg=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)(366016)(376014)(7416014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?im2A08bB7BSO8c2wEEv8irnGHdjv?= =?utf-8?q?7DpptdoRa0sGm9CyjjeOJfpokj9In2plbqiYTpeA+QEyYg+ZZeQy/ti2lDAtp2ipl?= =?utf-8?q?gINfsPS053lfFFgo87GPlaY5C+zgV24HPCKTGBzahb4WtrE4C1UsQ3CvUkymSR1/f?= =?utf-8?q?pR0j+PAyOBUP0bsFjXuBvevVGEcNrhv9jDeUYmy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dm8KJifhzN62Wu1uUN1?= =?utf-8?q?gjxqNyG/ncaVtChEwD0byUBZa3oNPKGYOAeWz0KmsBFB+gdoEZIASbXpSiQmHB4g1?= =?utf-8?q?2NZrEazGA1vgTq+tnzZVxXQ759IDiyYX03Z7yGL5ueQym+kbRvw/hs5qHhVtdsW/M?= =?utf-8?q?drIFs4WvDHBFocmzNE3hRoMYQIhmMCgCEmfw8TTf/4ZTdOzC82RxAc6oSxWdrjqYd?= =?utf-8?q?gXMXT9QbjRweJNrGh3ChR9b8sgS267n9KHjJhwwFKGK2XZAuod/fiSl20J6feIbWW?= =?utf-8?q?4pkpWdaC3e0CaxoyhR8iLIRDKIdQ8AYP/dYTkyZgkjblW0O9t3PrRvgKdybaZBZJ1?= =?utf-8?q?dq4c0Eb3fIEPlS2a80xGz9IErsjwYvmCZEYQN9MwQPppI4Z5RORjxaKWHt3rvex4o?= =?utf-8?q?zlJta3bYoA47X6guk4RaNv5QGJO+i8qUJ3XAPflNtXwMrXnTXunNpERr3OVkfS4jr?= =?utf-8?q?S2yciphA7I/y?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c339bb61-14a5-4cfd-9d80-08dcce914984 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2024 16:30:57.9955 (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: CfRVrV+cfT+OrcVwJHixo2yqqNFUO2Fbr+7EYbVOTdVc3t2xZeFlJMUTZ4OUBYy8hk8+S0gjoYyNHiK8n6jINg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8405 Add 2 software manage quirk properties (xhci-missing-cas-quirk and xhci-skip-phy-init-quirk) for xhci host. dwc3 driver have PHY management to cover both device and host mode, so add xhci-skip-phy-init-quirk to skip PHY management from HCD core. Cold Attach Status (CAS) bit can't be set at i.MX8MP after resume from suspend state. So set xhci-missing-cas-quirk. Signed-off-by: Frank Li Acked-by: Thinh Nguyen --- Change from v4 to v5 - fix the wrong when rebase - drop Thinh ack Change from v3 to v4 - rebase usb-next Change from v2 to v3 - rework commit message to descript why need set quirk. Change from v1 to v2 - use {0} --- 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 8b88649b569fe..cfb59f6bf5dde 100644 --- a/drivers/usb/dwc3/dwc3-imx8mp.c +++ b/drivers/usb/dwc3/dwc3-imx8mp.c @@ -145,6 +145,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] = { 0 }; + 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; @@ -207,6 +218,13 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev) if (err < 0) 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");