From patchwork Wed Sep 4 15:49:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13791164 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 8DA48CD4F21 for ; Wed, 4 Sep 2024 15:53:24 +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=oh5rmW1fK+ikUT7LDb6WhkeuVrD+/rsoKDvoXvWDMc0=; b=cVGoJfPIU2nwQr188kt8D/PLQZ PVxmM25TdkqMzB5R8KYdxMnBcI2ExJ2ujkUHQY2iGDYPLkuL0kl2JmdnZhkP0QQ7C9oZe8U/luP9n zk7N2xZzCkWgDXp+sQpngqLg0gZQWbqzJuaGpeOmScjhdn3SvdxXkw4bbHCtUYC9djk8EKS40mIGR FFfW+1Tx3ncPQ7QRJY2P1Rd9W9K1970ASn1q9rcO4Id9egNRuoZw7WJqaEl5u157YE3pvGQNeoNNh CVA7Ab4sma07NrT31A6uVBku0JvGHKAlmxQKPjiuME4G0M+2p7GaziLXvqGSetggtrPjLNzzPajWa K5itc78Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1slsJn-000000056zN-0oZF; Wed, 04 Sep 2024 15:53:15 +0000 Received: from mail-vi1eur03on20612.outbound.protection.outlook.com ([2a01:111:f403:260c::612] helo=EUR03-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1slsGH-000000055nc-3jYe for linux-arm-kernel@lists.infradead.org; Wed, 04 Sep 2024 15:49:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zIkltuCE29oY1sIEWRe/gVXif7sy4NGn0iUeE173OYCwp8LH/lLXBEL0QMc3fp4sg0pxyqer4yQMfjTV/ddiQ2LqE6uUYPvE5l5LApxQtOINfoMmfsGG+K9qotVx9Y2o3emfKzsqn99cIH17A7KblKQHT1H50wB45NpeSRJsPLLy4hZxPNWaEEG1IjhCakpVuKje2NpJQXHFOLfsFEUdivmuJjthe/+K/+PJNc5nXOi1vBOBId37boCmVm/gai9X2sGEN4eavCA2eLeZrxVVHaummaD7lh2c7uLZnmAz3HAynmemG2j2ig66mdqBec4TnpQt0S27UCp9GRUlK9DAJQ== 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=oh5rmW1fK+ikUT7LDb6WhkeuVrD+/rsoKDvoXvWDMc0=; b=t8eajuuwIHHDdiz9uhnNbYNOsEPXtG7FMpZlW+O9NrZwAa7YjO7ylbnWSbYjXKDdH+uNkwuyoD4OdPMQJUHPRQRv4koQVkk4HiyJz9z9uMyOa6WQuptGtdoddtKqbwPVbODD1rIscPTtoPSdxcVCALhNh6ScO5ImcDjs+UlQsSUYYdc17S9J+rrDL18KXGHmtkJZ6Rwihhbr48Bvh/EQd/PWPD9qQEbn2bfvllK9cwZItgc/ZwxH5y4SHGivmz5g1fXBu4yu6DTln1Uh3eTCbbp33W4HHtHe8FYPyVq2xvP04SeaUrECukseLP50KCFlBJwOxM0FYhWquu1fK5KtEA== 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=oh5rmW1fK+ikUT7LDb6WhkeuVrD+/rsoKDvoXvWDMc0=; b=NnBUXOBWBcrM6O8i83QPWKAjWBhfQv5tT+vq1BeW1f+l4OE8BOBSKTp89pbYjnUjlHMzOju6HQkMs4Y8174Jwx6adziQVx4ebYAOcoWd2GWB+HXvK+4q/mmpykLZ2qe3J+ILKj/YRVgSrQjWyHLXvHUOKgD0la5vsQnUNawahJlLPtVBL9zzHgQszip3F6EBEIcycBttNKPvmbjALRDGLutdEZSYncujx4j/h2p9h3FBUVnQAMp/XIz3nn10PedbnoR6OQlfwWex85JI0nGPYQX0E9gk0EqDr9AOqTJaljy7f8P4fgK5iW9LH45mn8yPyHo26o62WXRW6vlR8tWHng== 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 VI1PR04MB9859.eurprd04.prod.outlook.com (2603:10a6:800:1d9::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.25; Wed, 4 Sep 2024 15:49:32 +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.7918.024; Wed, 4 Sep 2024 15:49:32 +0000 From: Frank Li Date: Wed, 04 Sep 2024 11:49:03 -0400 Subject: [PATCH v3 2/3] usb: dwc3: imx8mp: add 2 software managed quirk properties for host mode Message-Id: <20240904-dwc-mp-v3-2-319947736ec0@nxp.com> References: <20240904-dwc-mp-v3-0-319947736ec0@nxp.com> In-Reply-To: <20240904-dwc-mp-v3-0-319947736ec0@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=1725464962; l=1819; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=SSBQqly1oyxDE2Ca0oLiGpwaCWTsOBymC3u7/XHMbO4=; b=QF3lcAmlCf/msSXa0QMewUP3UY+m0xPAdXfEtj3CUT88dq1I9QU7B6EqTftF+1svkyz2I3t0g nNm8rS+P3/uCS1HNQxCLyILEid/GSR2214SnvfhHByPINWXAkd3t3q6 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0008.namprd05.prod.outlook.com (2603:10b6:a03:33b::13) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VI1PR04MB9859:EE_ X-MS-Office365-Filtering-Correlation-Id: 305fa641-1dc4-481f-1341-08dcccf92b35 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?qvXOzJ8IZsiaaKht/+3VqWUQoKE+Dj+?=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/rSJNBDLI8VEsamSNPbL?= =?utf-8?q?jTjLiCkR/tgQKZ52BrBLLhh0U2SqDSvnPd7xZn2JjtbCi3rvMkzVSOwROJHZlg3Zp?= =?utf-8?q?+ycZ54hFbXDp0uMxjJABJTrZXgP3tU1J0UPH/E9Lvil3evTcGMLHZg7WsqZ2hy7fa?= =?utf-8?q?Ut7aXk7YP4FTdG0kkR/eZ6GpHnbyKXN+a3BkBtlGQKMGHRqsQhO5GL+Xn7BPZ2GkA?= =?utf-8?q?gUOupQHvPmRkDXtjYUzUMna0MzayD5P1bJBEb2l1NOXULMWzsDFn/P810obgYAJbZ?= =?utf-8?q?GxSqqExa/VotAPuBkhWaszxy1xZW3ATbrH2bJ//0P32InZv0Q9H2zsbmGjtlru962?= =?utf-8?q?qh19EJtImlZb9QAkGAxatXGw7u1ewgIEWWcKrloQ9G+d8zp8/V26sROJxVlg9AnqS?= =?utf-8?q?4KehCyo/JoZHJMrJgwSEpGyaMCINnc8XXDsyKlgfmEbFp2alVpGUzeR7gbZMiorU5?= =?utf-8?q?fa9DinfsVl5dBkxYy9W1dyfu5yo4b3g+dA=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)(7416014)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?WcJRrttkKq/R/Om8UjCazOK8sjVL?= =?utf-8?q?cTElAg0+lQZ+a1DqhJ/lBvosmv4bJAvAQVde7aX2adfE8bhr8Y3HQwcN9zBzDOem6?= =?utf-8?q?CZNJEX6K68laDBQBGit0BgqgM/AHQGaQbZgmKpnMph2IZsbU95Uo9uCzzhk78dor3?= =?utf-8?q?wgHxBP8lZ6BIahZrafUg4uiQYgf8HO4/x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dx6fQVylvVB20PoHqe4Fo5nf1pYkwe?= =?utf-8?q?80B0vx2vz7u/due8L6W8a/i4N+klZbyDMy1nI073iSpXKFYYh5GkWaMIbIIxI3ucQ?= =?utf-8?q?LIM+9Tl3rlTMIw50VVfcidIcgVJMvJtPIKP4lrj8DbbZ7jpdg4V9w3rDjcokaeYMd?= =?utf-8?q?EzfOxHrAN5q9qwuufxa4NzUn0L/BK2yVYbN1RijpUy7AmBkQm5WAcMnOI5v6M9CPY?= =?utf-8?q?+vD8BhQYU10K0SiYpkEO0ztDbjdAnhzrCrHqW3RLOVrwS+/8xdHlkubIqqDnazBc9?= =?utf-8?q?fI6+AZM82YxbaQz6I3YGBmBkJEyOnndO0Lo9gi3Guol8coAvgA7rG8zzz2Bk9G7wh?= =?utf-8?q?IHuNLVzzYG3+rgIgUxx/Hm9obJ5lTWew9GGNwGKXAjgoox6xR1XB7wyw9Dx2cjbL8?= =?utf-8?q?PgJCX6/C6kLIWajLLo1H7f1sqsFFOCLMG/F12Kisyq2yD2GLQo/2DH05bWoQdqAZg?= =?utf-8?q?sE4VdNiZb85o?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 305fa641-1dc4-481f-1341-08dcccf92b35 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2024 15:49:32.4584 (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: WwqYLs+odmds+CMXJ9RWxd+Bqe20X0CWg5/kqI/J66sWTdPhiWD4rx+yBh2PB2ZyW/pEBKZDBgxaGAefxtnMgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9859 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240904_084938_045565_A9DFDBD5 X-CRM114-Status: GOOD ( 16.45 ) 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 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 392fa1232788c..bd6953246f42e 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] = { 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; @@ -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");