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: 13794457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DADFDE6FE2F for ; Fri, 6 Sep 2024 16:34:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=P1k2OidQaHAXcsu5LAg151l4XuFwaAcxreDyaPLNuRA=; b=NsTdCqZ6sUFxQTDkJfhK+Ek+B+ scAfy/Il9BNjWH0AGD8HzTnPtzm171scIuMrha/X44VizuSYv9ORkCWzWfE6yMqOeuS4CTMa2V2QA cJCjjLDd7ppM0xEdfmlL6lC8CBT/Sb5E6d8Q0K2uNoJf6bR42Bbb8coTBmvjgttaq4HntIkFFLwIn gn53+9UI80QCSX9V+tjCX10u+ud79t199OZes2+NYTT0qe6Am2WYkCJBprzsAE7ZOkFfLf0E4qKDE fWcq1eXvEO4QyaUTg4SLowddrdXSIScwtOTYM9/vKzqQqfR0DlU6ZkaZcbeABo0c/9Mux+O/AWOES dlwmZzYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smbuO-0000000CzaI-2edJ; Fri, 06 Sep 2024 16:34:04 +0000 Received: from mail-northeuropeazlp170110001.outbound.protection.outlook.com ([2a01:111:f403:c200::1] helo=DB3PR0202CU003.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smbrV-0000000CykY-1CUw for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2024 16:31:06 +0000 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) 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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V/hm7tfrB47/Gp/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+PAyOBUP0bsFjXuBvevV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/c4vKrHvyZSMDI1dm8KJifhzN62Wu1uUN1?= =?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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240906_093105_376464_3E75C342 X-CRM114-Status: GOOD ( 16.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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");