From nobody Mon Nov 25 11:26:07 2024 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2064.outbound.protection.outlook.com [40.107.21.64]) (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 635BB1DFE12; Mon, 28 Oct 2024 19:06:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730142400; cv=fail; b=cOB55Aq1SqyS0LX4Fudh95Ig/dwb+7HV7+PevEXGjGqYnTMDRRatAn3SjkgRIXTWzMtl9P3vWhfOHumnJYw9bRH2RMO3ocodKlyodb2IF0OZ9qjRvfR1kaB0fZ59d501jsIPc0cWFduDfPaJS0cqjA7r6Ef9tP2NR8HWNBtg/9g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730142400; c=relaxed/simple; bh=MHdl1pBB8ltbGON7gH0Psda0JXVx4MU6Xi578sObIvc=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=MWZEjDY0iwsucjueILUQkeGumSRUKUtaheGfToRJOgZ+G21eYGVdeydE4TwnZcAe8gmhqgrRZnSaxutQXBDHukwbpX5nacVe/4LaInS8I8Ace9typHDztheh1waxHbdZexJin8ZR4iJhE1P4KTy8gvhfpW94VdFIY2uZYpTK2BE= 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=kwSBa+XW; arc=fail smtp.client-ip=40.107.21.64 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="kwSBa+XW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Rl8rssUPgB7EqAco+rWgN4AONyKlI2GMKHiLYpZ90bOPM5DX+oYY4jgl7tJvUYFHes/JwUJjwymV0Qqm+jxmSJd5BpirOtOYJjMXMSjbdEGOByFpUkX0JzqfQqU3zWLQ2mO44rn3mlV4tAZuKSd/7TL1nZtv1pt5dEVPN430gekYJM/pA92gyvh5kYUsOzYiBza0FeZ+gVbkW/xKg3Y2Dkze5LWz7TOiGUBDC18uUmtYOEoC31LE2pbrjI0jzEqWSH+I/JUrCPiBvuSOS9FI3ORAVljOLLU8MzFn491GFg19yAjuetmL++3ajntIFrG9XaGZp1MK2MMkUzzBsmRl9Q== 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=VMSng6Hkq1ZytcY3Ph/5wRTVWQF53XvR2y3i6XkNIAU=; b=hKFWGXSLsciIIHk9poOQIr90ZoUGJvTnc2LobhrrvIStDgvRmXYNspPkGhFtZjYblTYXSM2B5Pk2Cl231cu7Z1LJkgmna6glmFS0tu5BTgf9wGqEhjDQCSfseTS55F9eKxnMtexiL46kNcvnjrZyc36yPQ4YbZJxhcKhYBMA2XQV8US2x6fTZnZK6gEn90svbW5x5txUrn5TlzfcALo5DRzWAWVn6Kmj9BVrKDBuhC7JJAFVT4GIjUr5c2XawR1HzO/HX2ypuvwuJKQDOVxqETInVBoDr0jrIo4pdFVZ9QMFDVLXM59TlLaK/XBADmUp9lxIqxO2NH6sJWXMFJTvhA== 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=VMSng6Hkq1ZytcY3Ph/5wRTVWQF53XvR2y3i6XkNIAU=; b=kwSBa+XWWEKfv8Ow/I8Pq/QWeUkEWZuB5giKah165ILfxBvigkIIGdJQVbBj3/iQrHi02kcYjDz8t7ITK0pHWzoM/iN3ki10/xu8KgWhpQ4WRj0i4H5VraUAyOH/jjiDFrgHOLxRi9vIYvw4U4R8YYWutOzYB5TL82QP+ZMOejaklVhSGum5BBb7smLRQ5+ONfkvTSPXE3gLU1K1WHAHEPJi5NT4V6S8r7yEdIxO41M5ofm5YfLeHrMkxJHLrVn70qKrFJ5PeU8f06wwGd2wI3whICrVPTNbCh2KHZLC8ODKS6LeqwNtWc53cTTlwI/8tQaTP+QFD5AtBnPRQ5QBoQ== 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 DBBPR04MB7946.eurprd04.prod.outlook.com (2603:10a6:10:1ec::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Mon, 28 Oct 2024 19:06:35 +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.8093.021; Mon, 28 Oct 2024 19:06:35 +0000 From: Frank Li Date: Mon, 28 Oct 2024 15:06:00 -0400 Subject: [PATCH v6 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: <20241028-pci_fixup_addr-v6-6-ebebcd8fd4ff@nxp.com> References: <20241028-pci_fixup_addr-v6-0-ebebcd8fd4ff@nxp.com> In-Reply-To: <20241028-pci_fixup_addr-v6-0-ebebcd8fd4ff@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=1730142363; l=1266; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=MHdl1pBB8ltbGON7gH0Psda0JXVx4MU6Xi578sObIvc=; b=7wUDVK/qc/0ISWrgJoCoXb3D5iiXVsBocxv53p37ZhxLt0LjJqo1X/hN5j1q0wzpE6MNwd8La s2ecKtb1BEPDqaXSP6/atN5z+Rz0exk3hLtpdmJKiRY6peboJCyfSQi X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR03CA0005.namprd03.prod.outlook.com (2603:10b6:a02:a8::18) 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_|DBBPR04MB7946:EE_ X-MS-Office365-Filtering-Correlation-Id: 678cf69b-be54-4e49-c5ab-08dcf783a492 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|7416014|376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B?= =?utf-8?B?OXUzazYwOGlUZ2NyejM3Z2dGY091b0lRY0NWU0pxMUJQQVhUR092bng4emRG?= =?utf-8?B?Q2NaOTdtVXkzQUFrbFJLSmJNMy9leE9CL2VqQ3dQaEFDVjVCb3p0YlYxV0FQ?= =?utf-8?Q?uICSiRfuaDJ8G?= 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)(52116014)(366016)(7416014)(376014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eFZIekJlZytYalhybDdkZ1Iva3krUEJSQ2pLK3ZBTzdsMEh6Znl1RkQzS3NJ?= =?utf-8?B?VkhtaFZIdEp0VVJqSll0TnArQkNLZDFDYjZndE85U0FsTitubW52RVU3SzZS?= =?utf-8?B?NXJ0VnQwWGQxTDY3SW5UMG0ydUhhWGxyZHAvZXk3TWJBYXRwQTdRMU1GbENn?= =?utf-8?B?dzBudDRza1hMNTJrdkZNUGNQbjJWNW5wWWJjT2JFYnkzek82ZGUxeFZiSW5U?= =?utf-8?B?Y1FzRWhvR2VmTXZvQVZaSWJLc21ENG55U3BPOTA2QnB4K2VrVjdOYTVzRWxu?= =?utf-8?B?T1FPSGpMQ3liOUgvVGFXaEdxeXFwbnBINXpLMlQ3Z1JVTVMrTGxtaGNGTWt5?= =?utf-8?B?KzVBMC9NV3BEeUxoTXBSUWZYd0hXZ1JsSFNKL0tKcEoxSVBtR2Y4S1dkb1BF?= =?utf-8?B?V3I1Z2RiOTIycmhJUGM3K1cza0V3Y1IzMEd4K1o3azFuVzNpNnBXcE5XTVFF?= =?utf-8?B?ZUxZQ3d1MC9IemN0RmlKeGxDTktpQ1NpemwzTlNtZ1hJRXhTQnZuK252VUtU?= =?utf-8?B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c1lqUmpLVEZvL2ZSN1M3?= =?utf-8?B?bWVPcFhPYitHUU1vRmVNZmRCejVBRVFaREpSRDRSZDVLNFBCRXlheS9KVE8v?= =?utf-8?B?UHpIS0grT3d1NnR3ME1CQnJvckhoRXJZWTc4bXkzMkR3VjNwNStoUDdBdERP?= =?utf-8?B?K1JPemxhRlFuOUw0OGhmNSsvTm81OE9FakdnY0FhSWIxU2ZFRDRRR05JOURl?= =?utf-8?B?NGxYM0Yya1NBU3NadUJ6NzluM3JwdXhTc1kzUmlGeFBEMnczWmpSRk5GcElu?= =?utf-8?B?NExEQ3FBcEJiWWp4NU8zbTZ6RWFLemZ2dGJQcEhzN3dlRCtmQ2Y2MnVZb2RI?= =?utf-8?B?bUE1VitQajhmUUE5ODR0V1labXpCK2QxbE9PYXd2UHh0MVlSc2xkQ2xwR3J3?= =?utf-8?B?TkJRZGN4aG9IaVhPNlNDZ1JKWCt1THpGdlhmZzdxWFlyM1J2YWhZRzJxYVhZ?= =?utf-8?B?NmdhOGo5emNQczJmaWt3UnZFQVh2TlMyV1FheHdNN0dCZWdPdUI4NzA3aXcx?= =?utf-8?B?UVI0SjJZeXVQeDUrYjBhbVVKdkVmTXh3azB1RmpGN1ZicWlINi9teFV4a283?= =?utf-8?B?Q3RiRnRPUGVjeUhLWENLL3B4RlVzZ1loTG90Uzk3MTArRE0ySjFGbWJjWWtx?= =?utf-8?B?bkNOYzRBZWJ5Q0VIN3pCejJZbzJDNmRlMkNzZEJyUHhMcHhxMko3cUE4dWNO?= =?utf-8?Q?3ldZHoPczDFpXkujVBO+C0BJB?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 678cf69b-be54-4e49-c5ab-08dcf783a492 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2024 19:06:35.4833 (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: ApzZgWhIA5RqpgnstKTIqxBvurNVXszvXzdVw0om4KFMvkA+UApK3RvOGZSjwfT/JZrCFKjwsnWjY/UmBTyKQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7946 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->v6 - 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 533905b3942a1..8102a02a00b38 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