From patchwork Thu Sep 19 22:03:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13808013 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11011068.outbound.protection.outlook.com [52.101.65.68]) (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 EE3B11B2ED8 for ; Thu, 19 Sep 2024 22:04:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.65.68 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726783469; cv=fail; b=J7MSSut66hzQuhMOU2IZtQ6ZuDSml/maBmk1IThC6PgVywqQUMgTpKYKkMH9+8IENYd2fiFX+xIiK5+rjL9tLxk9+q/Vtm4CAB6Nh/kd+aYL0CkZ7z7EUPNImOp4GuF2zBCdFaWWdBOxBZPRMtdAQfzyMcIRt9Kf3ZLDfrDDhJk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726783469; c=relaxed/simple; bh=dDCIqEiGeYvyy7IOr9TuFKqg1ZZuhKUnDbXG/Msug68=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=M3bS8tRF78Y/78Veqm08xTdfL1wZJN5ppWSOH2tOODN1wJO5t0NfH3OMVn9NKQPwrTWmZW/7xYyJQHIlzE90+btXTtPiUUUsDErtt70ZdZY/T8LhcJPHkIttXapdsmACDi0Duo9Qbiy9juha1ohomSA/Iuhu/YJMSEXbJ8wezmg= 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=fBerPRkJ; arc=fail smtp.client-ip=52.101.65.68 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="fBerPRkJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SsPJjtb43qFkJbxlrdG7mWfShFVv94F9l8B93i/U6h5EhR0yT1s82q7DWvNh/VFGPDkpyAqWvbHwb3kNzw5osYvzDhjpUjaxOlVjdtBmaPfSWpfScdxMaTlCo8hHTQPbk5sTbGTZRdDxq7rn5k3ZkwzcnpCF3dU7DUy4meIZMiWG8CPHjinLiKu5kfHPb6TSJ3022TpmLANvsgP2ZadBAIK8x2oN3vUljh2OFaYcRmjhbYY9JLsXnJt1wYhadEP10haVBt9FrtIbe+P4X7ismHlqFr+LKNbD0AZZrVTh3+yS2OrKjZZg8mHmpdoZTAz7iXjNma6ZCd8nXhYUyri6kA== 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=wuX1Jv44F0T7Lrz9ExIWNFVs/gpRUetjCUAmSbU5G+M=; b=cjkblkemwF/jG0qLrED49SeURvSRKOyfNmFKPMJpiII+AwIyb9LGqBNqUZsChph6gdnkTRav3ReBFEFbKnGuUeBjDlH44dhBfxXRDd7hQbLiW6iF/RQ7UK+6op9UXZyXeaeMu8fXVWayFCqHricRx0PEDUY2HHYi5bD1CtYBHswZar0fkyKTggxxitwapS8+CUy8TtDarP0Pn3WoX27FbcxE9Gdg86Y1J4s/vVB63FiZ9RIUgIznGe04MhhFOhyG3AAoUQYxsQeFwcDomZ88i/bt4L0qZ15lUaMpC3N33Uq1utjAExMsfRGRXWujlG/UAqbphaHpHWgXqxRzmOIfuQ== 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=wuX1Jv44F0T7Lrz9ExIWNFVs/gpRUetjCUAmSbU5G+M=; b=fBerPRkJnMcJ5loSduPsBhFwbUavmWFlQXatSSo2YSI5Qm9CUpKaU77sc0clVOyQeDsySxSWJZLFGKYhEUoDm4XG8JW/D1jT9ddstmTXdfXtwSE+zOIKUaovVOIV9E0+Chpa2UoZXRCzQNU3lrTG7wEXlu9hIEWsCyWtBSNgRxnGzs1kkt9BtmxWaAVlkkF8bO7TUMRBypaV2uDVjyQ4D23e/QMv+E1b3g3TaX54U02S0KRFj14rOnw4lpnfc96Xc0qNCC0brYXTaHJ4jdpb0pJeRCHxOhudRXG/Jo3XY1+DtK9XIpLR3MVrPxP5gTSJmLvSVu53WAxTAon1sLUT3A== 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 GVXPR04MB9849.eurprd04.prod.outlook.com (2603:10a6:150:112::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.22; Thu, 19 Sep 2024 22:04:25 +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.7982.018; Thu, 19 Sep 2024 22:04:25 +0000 From: Frank Li Date: Thu, 19 Sep 2024 18:03:08 -0400 Subject: [PATCH 8/9] PCI: imx6: Pass correct sub mode when calling phy_set_mode_ext() Message-Id: <20240919-pcie_ep_range-v1-8-b3e9d62780b7@nxp.com> References: <20240919-pcie_ep_range-v1-0-b3e9d62780b7@nxp.com> In-Reply-To: <20240919-pcie_ep_range-v1-0-b3e9d62780b7@nxp.com> To: Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Abraham I , Saravana Kannan , Jingoo Han , Gustavo Pimentel , Jesper Nilsson , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@axis.com, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, =?utf-8?q?Krzys?= =?utf-8?q?ztof_Wilczy=C5=84ski?= , Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1726783409; l=1068; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=dDCIqEiGeYvyy7IOr9TuFKqg1ZZuhKUnDbXG/Msug68=; b=a+2uWRpQ6JztJf2z7lwr76pcyuFB2hb3FkIRbnnPH+cJPKS2VS92W0XyvHpd87n4N22XS6UA7 O/kVJSZWcPCCRwshdp/DVO9y1xdL+Lng7iYFmi4fG6o1tAHohBYtVRC X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0057.namprd05.prod.outlook.com (2603:10b6:a03:33f::32) 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_|GVXPR04MB9849:EE_ X-MS-Office365-Filtering-Correlation-Id: fb61c298-efea-4806-99ed-08dcd8f70625 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?PXCaU3u2Kz8S1BycTAT6A04LnT9X5q7?= =?utf-8?q?35hUL1BSy33BjCsDH5hdU8RDccMq2fbLTt3H/tb2Dzjr397MiISrwrR2PQuebqHM1?= =?utf-8?q?WsKvywc9DAermy0+At/vFGitcP2DD5RiQ+cCn4bD0XXOFS+MTjlLr7uJbiZeDTKox?= =?utf-8?q?9lIp5l48/zLvwG1PS78/RbNaRlX7K3XWWPejIiJQHG2qlbRVAUqBd3sjlf8oSKf6Z?= =?utf-8?q?lY+xExmiUZI8tKFuxCxfntYExVce4NJsb//diBkujr9aWJv3rdYxbZsFo4f6F6ThY?= =?utf-8?q?Ef3i5+FaabBT0Gv5xU8sYyWo6i5zss/PtLy/hc5jguFr6/ZqkWBxZYpWmm8ba9pij?= =?utf-8?q?HMy9KUpvv3lFrysBgcMwMQuUsyZswOenHuVkUNiI5Ehi+CZhvz+8i1cIqH9KYdFc9?= =?utf-8?q?vCYrjnhrw2UvRjDQgsGesYmGtM2mkLEkcDiPvzwcIA9nM+2gr1yWsgZGpQn0RuD5R?= =?utf-8?q?Nuuk8GTRALaqazpNscjA1ZX0CdMfrly7JI+SOlACoQa3pZSW86hfLRbHywlQeUv8m?= =?utf-8?q?lu8kmhG52CzZ5jgb8H7uxTqgC8IZcjVY8I703vQ3aEhVp0W33wSwReXYmEqpvJh0p?= =?utf-8?q?OlBsNNF+WZUSFoERmlEWc0YYtAv5W4dK9pj0P0k4xtMAiA0mBkj/fOLltCLDqtt5W?= =?utf-8?q?ibIwN9YVVq6Dqn459m6wq2Ojnfi5Ycs1U+lni3Pgtwx+UhFh7J/c2I68eC6QYgyaw?= =?utf-8?q?3cG+LxOFxRRFoLTJ51eRR1ZANH9SzA1JbD6KCQXEtRnkDjgdv58yzvYXlKcooOXLT?= =?utf-8?q?ig5iz61iFM5ymfXMaNEFZIdiFkqWWlov04ma+1kBSCB6YqS9PDxSD/+hZya3d6/PQ?= =?utf-8?q?/0eSAekXbDfa07JuZhvTFfdTcHJh/eccvfaD4sWCSwbsmdiC1Zvmjjj6N9+6P1to5?= =?utf-8?q?Th14pk/zhEPIrOw2AsHups1OCdsPQXo01He9H68RRb5QSyBh2TXVBssgb5z9h/yh8?= =?utf-8?q?EOvmkKHblBQiUsG9KJhq9fK1WZgc5+1F8asniQhvEDfjmzmOjm1XZ/pCR0oiSKo/6?= =?utf-8?q?kTaTtNPTOpPMBaT/HInFn8aJZh4k8qzhQl8CWQmctUuiUtjvBCMMW6U3ySzgxZ20c?= =?utf-8?q?PPb2Hrb/oDYoDGhFAJ7InKOnASTsdkDii9aUrkzVeEgDCL7QK8dulKW0B4bTCAHyx?= =?utf-8?q?JjUb+S4P8YQAbz2xiLNZ5+t1OGvoERYamJhQI16mSh1iSv+QKPfyd2doIMpaIQOt1?= =?utf-8?q?2IM90QEhNp3RIdvC1kAFQwCth8eDgdS1SwmZLerZsf7uwxMDmAb2PYx/CTDRirl5a?= =?utf-8?q?/yBrditjlZJZBcOXyaKzOued382Nq6m7+S8byalDd0QEiCwzhbw4mPdOISEe7g7LZ?= =?utf-8?q?R9V2comhOYuVOJjmRNNW6/CHWM2wJQS7VoIk4r40iNEa7m3PYd/s9lQ=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)(52116014)(7416014)(376014)(366016)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-Message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EQqduZ83AWlvs5JLMF+Kv1kovbiLVUDnnU?= =?utf-8?q?An/N0ri9CyBkYXxp2o0TUGB9dx+FjXjlBeLaCv1C2+Dg+qiGK8eMiVcscmLIKUuND?= =?utf-8?q?/ZTFXnatQhGr8rx3teV2OT3XVpvlco1skjWCTJ/Imir4F2t11Yt+/G1Won/stjLfZ?= =?utf-8?q?P8WsSIKbua0Ol7L9S4qDqfx9T0Bgo/1oyqBfnOie6pOv1LNRjaFJu3epuES+US4pf?= =?utf-8?q?/YI6mbI0iAkv8UV6FJfnCYHUmgPfj9s+i8d/u2QCw5xamT0rWmLRBZ/lfnMDXHUU0?= =?utf-8?q?Q2dKVZwjRYeid4HCMQHW1Hor+LzHfxs+n4UMcd8FfD0utpVT/gE+gqGt87bbQ2L4O?= =?utf-8?q?WujxQEyfzbEGZPmLCuXsMPKTOrtyi2z0jcbSuYggvq3PVuNuTiKy1sWT8j290tGfb?= =?utf-8?q?oHm54y09wOtegZJn1iOgT85WF1yXhG6/TlfPlm/OfwF5DaSWDzOu8PgYPMxj4zxYm?= =?utf-8?q?CClWTQERDgbmtsBo0eL3GiZ54GTgrD29PLOawEcVkXnlx96tdR72K6nIcNGV6bHEY?= =?utf-8?q?0DnoltXLWmWtwW4Zjs6k6CtM0I7cs5TlJQWDTCnkpJa55svtDoPlDEok1/EcGKHMJ?= =?utf-8?q?gg7akGPRe0jD38X000fBB7opS/a9+ppIH2JAYETM7xP55GdiM11RtvJ6/WaK04GqW?= =?utf-8?q?kjJb5R7v+9MD?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb61c298-efea-4806-99ed-08dcd8f70625 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2024 22:04:25.2825 (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: d565yjf2HuV5LZjq6td/BzUaGM3rJHPlWCLlBs0wb+76AoDwVCroeagkiMbJr+AwV0DugW981+Y213Yg5qrlkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9849 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, and submode") Signed-off-by: Frank Li --- 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 808d1f1054173..bdc2b372e6c13 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -961,7 +961,9 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp) goto err_clk_disable; } - ret = phy_set_mode_ext(imx_pcie->phy, PHY_MODE_PCIE, PHY_MODE_PCIE_RC); + ret = phy_set_mode_ext(imx_pcie->phy, PHY_MODE_PCIE, + imx_pcie->drvdata->mode == 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;