From nobody Mon Nov 25 08:57:03 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2060.outbound.protection.outlook.com [40.107.20.60]) (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 526271D6DA3; Tue, 19 Nov 2024 19:45:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045509; cv=fail; b=NploMD06MX5ihWnGFu2Hij4JkUdxCPGRNoux8ep+J4XNnHqcxlKSlGTaTiCxztLOfHAn+DUkydrgGwvTWjIpvnhYvf7amk4t4nyhTn9L44kc3zfM5rL604Cq8I2rurvO2m7Q1tVhts/TJqt5yZqxeKosllSE6gttMQUfhFQbKKk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732045509; c=relaxed/simple; bh=I1xS6x/bVgth6uCt4K17fnxBjFtfeZ9wcN/vlP80bSs=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=FReRVLzA4R7AgNV3nyltF81OOAeguUFkRArbCVCH3GyJUfIyq7BdL2WP2MfC3M4ZAyb2tCcyjmTSANqCFogbcJtb794FYCFFmBPhxo+DbYScn50h7E9UoOoAOWnzYBBTTTgieohMHVupmroof8vTAHWUvhC+HRVOPL1aGIS69Sw= 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=FxGHMjg5; arc=fail smtp.client-ip=40.107.20.60 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="FxGHMjg5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RhZiQcpeQzQs1p9cAthpkGgw4seZ01YkUNc/1ZTOFettsOmPI5sWlVPhVf+bSQ+/h8zSePRNVmtsvPjyU+U18bDaxl/FUoDAWKw7X8M1iMmfWd7V+9SbRYnvx0G0dAu3CQ0HNX8ABOEgFQ15NXmblhMgJW6+IvlqRDnm5KyZHGLzqK3ivyYrzY6+GGR21nAb0EyJ4vKyGEPl0aBpMe0rJqWrEPMITE8qE5JNV+M9acFTQPm1yigEMwn2f2uDV8spUczmREnJLQLHrl2zVz0RQqZNgnCV53PDK07DvBaLTB6k7kW58bcyl7sHJ31zvaNmRJRzZbuAHhJcHCtQPw4FFA== 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=ayvkn6j5ctMor6f5EgGeTcwZhVoL9kYC9Om0+bxxxyY=; b=teuODFJ1GCYdO7Zp6yybrrpR5hUTCLM2KlcYY77sN3deLpOYZvb0TRpFobo9RWBvsUUQj3FQfc84KCLIW/qt0rUzZsK9AKPct/yw8wmRNEmjwXxUEG4yQRTJCoQcbWOBdvNwimM1TDDxqZwBGfLqoYuo510jIXfFTSbNtQp2N958T/hmXRZphHehDLdqHSIu81XiciSfbRTODatDfpVq/3dWrBEnd9Es0co1ghmx/xI/CDEc60WsuE54sqCdtn+pJVINtN7baI1qJEHqrQoMFk9VpSUgsKaKxtQ9GNyBQU3yDFYmj9RaU6o2GdM+IM27eUVOF2RO91v7VbV5j88Okw== 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=ayvkn6j5ctMor6f5EgGeTcwZhVoL9kYC9Om0+bxxxyY=; b=FxGHMjg5kA/qrGfXCAKc1XNJ1yl867ATuns5FtCzzToORztWt0ugonCGpjPrjclGo/hdtirDTynhAf4eZK3sA8lFf2CwfdGPAI+aq3N9tJrFX0aHBbAAY17cP5i+KjpeMhHC0iRbfer7JzO0JOZUKuFPTkGcwkFBZHEC95rr8st8UcHwYvuvQ2T1DhfcJmuprtcO+iwX7sg25Zrnce2Ndbsf8uV/jvZnGOsgd3fTs8s+o/3O0UrwRoQyHqwiAK4H6GI0b2Gqpi2inwKGwv9z7TgnOmrSc5mxu3GXwtXZ1XD1vFDS2IylEJ6DhG6dz+WJ+AhKqyyiIy0UoFAR9UgO8A== 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 GVXPR04MB11068.eurprd04.prod.outlook.com (2603:10a6:150:215::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Tue, 19 Nov 2024 19:45:04 +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.8158.021; Tue, 19 Nov 2024 19:45:04 +0000 From: Frank Li Date: Tue, 19 Nov 2024 14:44:24 -0500 Subject: [PATCH v8 6/7] PCI: imx6: Pass correct sub mode when calling phy_set_mode_ext() Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241119-pci_fixup_addr-v8-6-c4bfa5193288@nxp.com> References: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> In-Reply-To: <20241119-pci_fixup_addr-v8-0-c4bfa5193288@nxp.com> To: Rob Herring , Saravana Kannan , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1732045469; l=1266; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=I1xS6x/bVgth6uCt4K17fnxBjFtfeZ9wcN/vlP80bSs=; b=tM6zs543BtrgjN+85Ni4hJ2pKwjs7eBwgMkk2DbgBE1oEAHzhCwHvhLAwLFVdTcqgDQe2qwb3 8xYSXCRa+xuB9yGDIQJoUsUZiD4KiTkVuFOsSBOLJDW02QUIYO24EYF X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0009.namprd05.prod.outlook.com (2603:10b6:a03:33b::14) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|GVXPR04MB11068:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ed88dad-ec27-40a7-6370-08dd08d2aa13 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|376014|7416014|921020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ak1TamdPM0w5cnVMUkNKbmNIOVpOMG9SWnB4YkxZcmt6?= =?utf-8?B?N2VtUnEvd2U3ditoUGc1ODR1TVN4cTh6WUFYaG0rUkt3cXhmakl0N3d1RTVw?= =?utf-8?Q?w3GiZ3A4igvS2?= 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)(52116014)(376014)(7416014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cGs3OVNHYWZpT0lvSm5yenhGWENleEU5cUlnRndDeVNxeFJJZWdTWFpuVU5I?= =?utf-8?B?T0M1SHV4bU1kRUlwVFd2QlpCM3prRU5FMThRU1dxbGdTRkFPNi95UkQ5anZJ?= =?utf-8?B?MTczK0NRTVZvY2JBRHBLWnVKb0hVL3liZlRFUTJxczArWk11SWlQUUQxUk43?= =?utf-8?B?cmJpV0hNTnlZb0lmc2E3ck0zZGs1Q2NoTW1OcHJyYVpLRXRNOENJUW9mcFNE?= =?utf-8?B?UDdVWEZnVXdKdUZ3cVhpbmNBbk1wUnIrUWRvQmlLekc4RkErdW9vL0xHc3pG?= =?utf-8?B?R2Foem1nQnJhdlpxU1lKNU4wcVQyMEM1cmkwT3BxRE80VW1aeDlkcnk3cWsw?= =?utf-8?B?RmRHajMyd0lYcUExQ1Q2YStmblJCQy9PYk5EVjIxUnpKM1lzY29lNGdNRWR5?= =?utf-8?B?QitKbXhTNmdaT1ZnM1hlcXFDVWVZd3lLY080MFhXVTBUQ1pmWnlQd2l4SmhB?= =?utf-8?B?WFk0ZUpVYzFyK2dTbnV5LzNrMnlRVmloRG5kS3U3LzFUamdmMXhlaC91NzVR?= =?utf-8?B?NmJyVlJ4aWJBUDJ6N1htM3VocFBGd1d6czIxU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kI1d2ZlMGlTcDk5RDdzbzRXbVRSVU4zWUpX?= =?utf-8?B?WWwzUDQ4ZW1IWG9iMThXZGo5RTVGZUZrZ1RmUzZwSVc3Lzk1aUlDSkNWblB1?= =?utf-8?B?TlExYXFXb2l4cUNvMUZ2dnVDQUZucDQ1c0dOb3poQmFwalFmMVFjUXdCVnh6?= =?utf-8?B?dlBDNm1leEhReTZPN0cwM0lPZTVJR0FXc1FyRkRzS0hnYjJoMjU2elhCQ1BN?= =?utf-8?B?WWlvTDNXZzluaWhSNVh6dmRGRFJFcVZWOCtuT2lpalJwWlRRdFIxSUJmZ0dT?= =?utf-8?B?QUVSSEdycEgrTTE5UTVpRVBCNDhBdUQ2bjFwVERXVXlNVDRBVXNIaWF1bzZo?= =?utf-8?B?R3NFVXBINi9hQ2tuc2grK1haNzRQNkdZN0FBSkRDMGl1S3NGUXFWU1g0QWNU?= =?utf-8?B?TVNwVzBiUlBiSGttWEJEcHd0ZVlCU21Id0U5WE9xeVllWWRQRCtwdHh3dytL?= =?utf-8?B?NjlWT0RoR294ZGVraWRCV09iNVM0b0tDWHc4TnFQVmtsZVR6SnRBVk5LczVS?= =?utf-8?B?cDJ3NTNmSVhCUy9yUk53MXRWbWo2SjNabk0xR1NoZUwyN1Y5Um1LRHNMdWFN?= =?utf-8?B?YklEZ1d5STJuV3Frb1dqNktzQWE5ekpzcW1QSWFoL1dRelg0T3RVWmd5TmF3?= =?utf-8?Q?HY4niso+Rji2yI3dkrhJfOS72?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ed88dad-ec27-40a7-6370-08dd08d2aa13 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2024 19:45:04.7260 (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: AQh1LdT33bwMeG+oRapj3Qd7ecwb2EOYLWRnHTlSPHL2KKgLdpqix2VQRTfC8NUaWRRkye1ISzoc/uBz5B2ruQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB11068 Fix hardcoding to Root Complex (RC) mode by adding a drvdata mode check. Pass PHY_MODE_PCIE_EP if the PCI controller operates in Endpoint (EP) mode. Fixes: 8026f2d8e8a9 ("PCI: imx6: Call common PHY API to set mode, speed, an= d submode") Reviewed-by: Manivannan Sadhasivam Reviewed-by: Richard Zhu Signed-off-by: Frank Li --- Change from v3->v8 - none Change from v2->v3 - Add mani's review tag --- drivers/pci/controller/dwc/pci-imx6.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller= /dwc/pci-imx6.c index cf033e672dbde..5303dfc3dbb41 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -960,7 +960,9 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp) goto err_clk_disable; } =20 - ret =3D phy_set_mode_ext(imx_pcie->phy, PHY_MODE_PCIE, PHY_MODE_PCIE_RC); + ret =3D phy_set_mode_ext(imx_pcie->phy, PHY_MODE_PCIE, + imx_pcie->drvdata->mode =3D=3D DW_PCIE_EP_TYPE ? + PHY_MODE_PCIE_EP : PHY_MODE_PCIE_RC); if (ret) { dev_err(dev, "unable to set PCIe PHY mode\n"); goto err_phy_exit; --=20 2.34.1