From patchwork Mon Jun 17 20:16:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13701381 Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2050.outbound.protection.outlook.com [40.107.103.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 5599F1991A4 for ; Mon, 17 Jun 2024 20:17:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718655441; cv=fail; b=T2PpFRGP8+7uNqLiwTwk4mhWmHW6lAocZvg07YbEZEY5dav/w9nuHrDChgLGm0LHX4urMetdUwOJEjMOAsIoSoyUcYQrMN4h/lWWLCuUYKwv9PU0EZHG8AyNW5Iclkv8lG3Qo0Jfn7vp59UJj4zS/W5eI5MGJoLRoZTBu9D4BNA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718655441; c=relaxed/simple; bh=bQfDRFUmBsjiBwmSYlRFuiuVTUjSe2+Qil7MOoSm6P4=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=ZpZDIJL47ygnA1yeqW4j7TaBWtxyy/2VchRWd9Ozcq2p664jkYohDf6O0k+rLxaHO6lzi9ui8yvmeCYj9yDhM8+0n3FkEq1FuleNm6mjV8IELPK+uDzo8PblSiaT2I8lmfZqnJcCelZRbCCKEkZ1QxVIJ/i4pOsXarF6iPkIpdI= 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=SZjWYQVw; arc=fail smtp.client-ip=40.107.103.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="SZjWYQVw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PKdDtz54JKCobdNItONe8nbWE/36Rk4v/Pk5EBb253g1z1P863juD10/LHNeRQQj712Lq5AvZ8AZ002+YEgv7ZDAmcjL/St/7XhZbh2K3zEo5jaceE1IdLpZTtEwnFFa+qI3EYlRfbMwZVipSrj/FafbwnAGDG5dG3dXVWv+wM45NUf9ZEL+ti8a1dk8KeL9dWGIBWyEURl50NIfBZ4THL7Ffi0P/yUzowFB6bDxLu12mAjhfaMj0XRToBMuOxtagyIJVAd0Za6YEqIZKDkncT8NSIw589ZqhZtAWOZk8nrelh8xd+TeCRHbLPdGoB/UZ7cwbNtkRNZwX6/yZ0la1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=T4C4bd6RCTWMeAWPYur9JFr3N+1JAJyKW82kjXipNJY=; b=Dj3q4Dh7tdgDbsAjgBpBf+8ppQo+EicBgjCcS1UDgFWxYC2X4cOLVQGI6fhyhXbbzgyJ1Yf4YK7HCocqKYX2jJjW9Iub5gUQojtPxmxRJ9Y9oAp3SBiSyxVE+nwbSOt0Os0CEvhFmG2SSAmjC9Ko62xoHHo/SPIlX1Cafv6mSuUBjFAJfHr2slZ89FZqHLVUsqwRRHLQbR8EztbyG4w0vJaTwdMF5TEsDpZYnxMHeGfbVaGJBkWgJCgQZUO1e8eLKdLSfyblT0VbwlMYETBAo7Lcn1QSrp2DjXawWe9DTSPsWd6uEButN0Mh2p4wMCmteHcGgcTbZEzntguQUwOltg== 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=T4C4bd6RCTWMeAWPYur9JFr3N+1JAJyKW82kjXipNJY=; b=SZjWYQVw5RN/vASJwdeRmt9czkMQR/8gE9rFrd4Oe2ehf4GTikqa8FBOVKD6oyD4ULi24cEkQCVaUTtrRXte7vNAO+tgi1YzhtL2fE055022T26tc52QkOPmmKZGLFdPiZMOd1gt6pw1gGXGn4jHrgiEwv3xQypAhMOGr0v/vgs= 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 PA4PR04MB7997.eurprd04.prod.outlook.com (2603:10a6:102:c9::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Mon, 17 Jun 2024 20:17:17 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%2]) with mapi id 15.20.7677.030; Mon, 17 Jun 2024 20:17:17 +0000 From: Frank Li Date: Mon, 17 Jun 2024 16:16:37 -0400 Subject: [PATCH v6 01/10] PCI: imx6: Fix establish link failure in EP mode for iMX8MM and iMX8MP Message-Id: <20240617-pci2_upstream-v6-1-e0821238f997@nxp.com> References: <20240617-pci2_upstream-v6-0-e0821238f997@nxp.com> In-Reply-To: <20240617-pci2_upstream-v6-0-e0821238f997@nxp.com> To: Richard Zhu , Lucas Stach , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Rob Herring , Bjorn Helgaas , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Philipp Zabel , Liam Girdwood , Mark Brown , Manivannan Sadhasivam , Krzysztof Kozlowski , Conor Dooley Cc: linux-pci@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, devicetree@vger.kernel.org, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1718655424; l=1456; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=K6q4j4Cq6SV/EGfAgEb3QEUnqNvPzUe6F4DIJInjKRQ=; b=5ehFQPKy2lBa0kl679ExySig2nvMKJxELh5ihOZtM3FBIJvsovNT59vYvM4+jMFQla1QE6SMc csswxe4WmdQAScA8TdHa14yccH71qL3duWF6PwJzPGFQ2n4SUJz0Myt X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0116.namprd05.prod.outlook.com (2603:10b6:a03:334::31) 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_|PA4PR04MB7997:EE_ X-MS-Office365-Filtering-Correlation-Id: b298ef22-d82e-4c29-816e-08dc8f0a7bc7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|376011|7416011|1800799021|366013|52116011|38350700011|921017; X-Microsoft-Antispam-Message-Info: =?utf-8?q?EVPDA0qgvDWQYf7/VnaJv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QSagWHBOswtVw?= =?utf-8?q?Mmw+pQ+xwpn9CSDSA2XX92EyPUv/peHhgR3cGy5aqNkS+nJtS/eSgkfUBOzgEfrBx?= =?utf-8?q?U3UgZ2bkNebcE4VI7Ya5ikqe3P5MWOuZthUWe7imhvcmYLAhxm7oqRl3hFYu3Epfu?= =?utf-8?q?FqM9689Po3yNaaSoiNSh5p7phIfrUUnPgPSehxDsWIVzzjVghErCms5/JYzdzMQni?= =?utf-8?q?DGSGN1RIPzkmfSoGhm8xLiM0KM7bZl7nkeARig8bEuWWddpkDITSO3g7uI8Z3zinf?= =?utf-8?q?s1jcM8c0qvh0A9fuEIO9cJfLUXvWFENr0qMzbopEpYB5RNVpcj80MV8CfIuSOFcgh?= =?utf-8?q?yDIJ614CrJbuK4jBjgb4gjvHhknK/w3QZ/iD/v+N1tg1cKLlPIrB5l1qH79W1wfEI?= =?utf-8?q?mnV6Igjo18aCGVJEmkzlljBm+f2ULbeQwx7+Qz7RpUFpytQr0aFrXS1VgXGSlMhKB?= =?utf-8?q?3PySKfm5I1wQ?= 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:(13230037)(376011)(7416011)(1800799021)(366013)(52116011)(38350700011)(921017);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?ckjOLgT00npVdiGXRNVvq72VbJwM?= =?utf-8?q?8afBfPG5ColBpgYtI0Vm3WLEwgnzhdgNCDSsoSRYov2YC2gJr6Saj/NQVUfyI759Z?= =?utf-8?q?DB4XykTX00vJQLwKInLHihGDjeRodsBoDKxHBV2XgVix9CEI34IB9svfsTDRxoUpE?= =?utf-8?q?Vrr+Fy9ZFWQpVVhlceUE8rBrs+/aOFXj9NJfVPcgGBLY0oXWLr2cissDFqc5DtvL6?= =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Daliqek5J8mbbuMhzHgCd80FhOs6FEhMACsBNCQVwKT6ZS9AXbrOmAG3oh?= =?utf-8?q?Frrl0+D1icEA4BqVNOT1XthWYNp0G52e5lZowFB9rFe34jAS2O2a32jcZpwat/ZvN?= =?utf-8?q?Rof5MFICqAk4nnniu7biQBORNS5Tj3CziGhNJVL7onH2Xhr9/qXf/kc29Ucws4TZq?= =?utf-8?q?6d9m9uamvO67cS3GZnMxwSwCe7gLDPq+roYXRsnQV/qvnsI6CHnw88WvpvlOSz/sH?= =?utf-8?q?iOrbrg8wLfDDNkgrG9QAMbxrEmWoRz/qXYwR10BtH37pTG0T9obZRpAO9YvvV6UJ+?= =?utf-8?q?s5AeapuP+We3WH6DplmJxNKvev/1NV/zfS1yDble4ztkBcz09u9okf7wOw93aUIXj?= =?utf-8?q?n9yXQbxPBxnAFwKFIyrSNrbGUAnGfc9pwqQpn8kt7mXhp6G8BNSWeYpRb2L2UVtbb?= =?utf-8?q?SJsDc9+CHDp1?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b298ef22-d82e-4c29-816e-08dc8f0a7bc7 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 20:17:16.9694 (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: 0Ut9r386IWK+QeHki7gkF5EVJ+/L5SPATUrCJn8t/feoWyP1HlqTzLFYjj5MuwCdwVX/YdbEQbQouPrfu7ZOGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7997 From: Richard Zhu Add IMX6_PCIE_FLAG_HAS_APP_RESET flag to IMX8MM_EP and IMX8MP_EP drvdata. This flag was overlooked during code restructuring. It is crucial to release the app-reset from the System Reset Controller before initiating LTSSM to rectify the issue Fixes: 0c9651c21f2a ("PCI: imx6: Simplify reset handling by using *_FLAG_HAS_*_RESET") Signed-off-by: Richard Zhu Signed-off-by: Frank Li Reviewed-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pci-imx6.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 917c69edee1d5..9a71b8aa09b3c 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1578,7 +1578,8 @@ static const struct imx6_pcie_drvdata drvdata[] = { }, [IMX8MM_EP] = { .variant = IMX8MM_EP, - .flags = IMX6_PCIE_FLAG_HAS_PHYDRV, + .flags = IMX6_PCIE_FLAG_HAS_APP_RESET | + IMX6_PCIE_FLAG_HAS_PHYDRV, .mode = DW_PCIE_EP_TYPE, .gpr = "fsl,imx8mm-iomuxc-gpr", .clk_names = imx8mm_clks, @@ -1589,7 +1590,8 @@ static const struct imx6_pcie_drvdata drvdata[] = { }, [IMX8MP_EP] = { .variant = IMX8MP_EP, - .flags = IMX6_PCIE_FLAG_HAS_PHYDRV, + .flags = IMX6_PCIE_FLAG_HAS_APP_RESET | + IMX6_PCIE_FLAG_HAS_PHYDRV, .mode = DW_PCIE_EP_TYPE, .gpr = "fsl,imx8mp-iomuxc-gpr", .clk_names = imx8mm_clks,