From nobody Mon Nov 25 06:21:47 2024 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2074.outbound.protection.outlook.com [40.107.20.74]) (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 BAA3B205AD5; Tue, 29 Oct 2024 16:37:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730219842; cv=fail; b=Qg15utxid0od7I6GT7k7nLKcOKjnc5WzwuHvBV2NjRIrYaCd3dR0woC4dz1GbWUYe7uB4SauhTufAKDcc5HTAU45BSNs4n29nZpQOxL1giZj+IApB5KJZ3NUm0z+k2M9kgnuHep97B3Dj8Y1kDW7Xv9da/ll2PkKWft5FUOLfAE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730219842; c=relaxed/simple; bh=lrLx8Z8SxZT/oJjco5fJswD/ZWUdBilHEZbhlGAZNXk=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=c7B7UHcMaB7zzwgxKOFUusjcSl2+8+72sGZFAx1JwyMNXMfFQwOuY8bbag9uwxd0iImQzsLCDvyo1aHRMePrgPcckdPuvVHFEi7rljuTZ6YnXrU+kVwkIlzW9iBSQ0qAj9srNUFRygutho0LJDclGBtzfpEzd1bX8fjcOWbLsck= 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=Vw8SfGzD; arc=fail smtp.client-ip=40.107.20.74 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="Vw8SfGzD" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dpindFmvBhlBe0ioOH4j4fJVGyJtmGuJNJCRs8+goRnLLIYvumA9Ffcg7z/MwA1A3HANZZN2oi9UCJWif9X9H1Y+ZnumLIditKhbfETycwtu9r/ZKeC/lgJbfI0WAa6NC5N0AC+mL/UMHo+QU5qAXlAUTHxRI+eg9CymeUXgTv2yqjaVym5VqIU0a8o4NO73YknU32lUOzkVXYJVSQT7Rsm/yn7I4twecjSntZEecGeG3z3u0Z/uD/KwkMSjZLYtZ/zKhx0hWRfP3GokGKrA9kiI32MPZnkeIrAv5+75kzbM3ejtkhZzq3mqxSKfEQU9Zp956YbOom/SLFdmaDHk2A== 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=rH+/ieqErUrPjrX69gEMyYnDDWNyEiJyuGTkw/pz68o=; b=jwml2pKyRZFNm1kpLvLVSueLkm3j76A420rq+kNfrqnXJkXDpyg+PX1FDilEGz//L3ABZxNSKMHp9ZsH8VrzBBoM2JiyFsdEEX8NDiZuIl1W1MbuCMqk8Lx58kXrXi5zWlbzcLy4CnXdz2xqKwlT9mQ7nmiT/JdcQr6+jwY1FHBds2RDiOYmbJCBRaMNGkRArI33E0Ioe/jv5vtRBOYm4G4fllSoxzHU0VW4jNvkviiiGpRjohR+WWbnIESW2L9OsXC8nRI1j/UIerxQ4gBmEmyfBHjyBro7yKMcLY4JX3HB9C4eY9S4uqfQ7oEj6OBU5SR6iq74g8FNfOcoLyFdbg== 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=rH+/ieqErUrPjrX69gEMyYnDDWNyEiJyuGTkw/pz68o=; b=Vw8SfGzDGnK1O9XUvG7rqCMaq3A/VnueWFnX5f8xZMSatTxziRo6xhB4PwI/iEDElEWeJIbKS9iQqterOiTVWbOtKCxSa9w9U0krr4ypYMmI2CkSowEiezq5E1aRqWKf+H8vTG7RE+XFfqN0y35bESBpUPJnkNEoc5EDCopwO4ihknA6kn6GNJGxtbxkRTcjPW/LSFSwHybDsQ9BuKTIZ1CeGjF0wr/zHLoWDeYZnl7MZGHB9Vvfy7J1+7M9SeavyTpdNDuDiQAtybG2KwcPZgFD8TrYIxzzPkFt8Qoe8YwwMtWU37RxNhkPySDo6cA+w1QY6QBtUd3NXelHGKJRZw== 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 DBBPR04MB7577.eurprd04.prod.outlook.com (2603:10a6:10:206::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Tue, 29 Oct 2024 16:37: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%4]) with mapi id 15.20.8093.027; Tue, 29 Oct 2024 16:37:17 +0000 From: Frank Li Date: Tue, 29 Oct 2024 12:36:39 -0400 Subject: [PATCH v7 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: <20241029-pci_fixup_addr-v7-6-8310dc24fb7c@nxp.com> References: <20241029-pci_fixup_addr-v7-0-8310dc24fb7c@nxp.com> In-Reply-To: <20241029-pci_fixup_addr-v7-0-8310dc24fb7c@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=1730219803; l=1266; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=lrLx8Z8SxZT/oJjco5fJswD/ZWUdBilHEZbhlGAZNXk=; b=c00KuuZdG71AFNsfjgrrDHH6bo9k8MvyBrdD4imApf+17/aizFO9WqyddXoQ2iQWZILpwQFCA SiNNMyuFH0YB0NOmr/OPdMziMPNgryYxb7vlJ+sTTaGZ1cmaPJbkZma X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BY5PR13CA0035.namprd13.prod.outlook.com (2603:10b6:a03:180::48) To DB9PR04MB9626.eurprd04.prod.outlook.com (2603:10a6:10:309::18) 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_|DBBPR04MB7577:EE_ X-MS-Office365-Filtering-Correlation-Id: 2147560c-08a7-4bc3-da26-08dcf837f329 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|52116014|376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kyUUlHUG1LbVVr?= =?utf-8?B?OTFGZnRteTJ6VHQ3eVNWSUlBQXIrellmTVVIUzNzdjVubm5vZ1pLMnpObHZL?= =?utf-8?B?V0MzWFA2ckhVaXhNeHV5QlVtYVAwWmpjMFFkZUJpcFBURHlYTW1qN2ZBM2ZX?= =?utf-8?Q?kUct+LP3Aur9B?= 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)(7416014)(52116014)(376014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bEMzTXI0MlVKUVd4ZnJWdVBmUjNiNTMxSG8vVW8ycXNOK0w4T3Y1TmprQ2Ji?= =?utf-8?B?TThOOUk1cVlYUE5FN0hwUUEyMzE2a2VVK3B3SHk3dVU4V240NmZRL09VTEIv?= =?utf-8?B?eUtoTzM2eHZ4a0JDUGlTSVdKbVJwVnFZNFVIa2hnYndUMlFpTUU2NjF4eGdN?= =?utf-8?B?NGdLdTQ4bEk4RDJkNjN2aDk3WE11S0hCS3RSYngyeExPMDVDVWxFMWFDN3lE?= =?utf-8?B?eDJuckJ6N2QxWUh2M1l1cm9zNTlQOFI3a1lvVDlOZ0ZZYlN5dDZQbGZCb29R?= =?utf-8?B?SWF1a0dXNXdxK0E4WUh4ejZHT2JqTU1KNUxpcWJRSmExbkZnZVg2blFxUWg0?= =?utf-8?B?d3Rqck1TTHd4UCs5bkhXMmhCaHgrVnpNRlRVdDQrNlE3cGh2UldlM0hEK1Mz?= =?utf-8?B?NGd3Ly8xWjQ3WVh3WVMrSTVPNEVEU0tkSUZmeG13YmlnRENCSU96OHordEpR?= =?utf-8?B?SlVxVkd4SkU1dlhVNTk3UmVFZ0ZsbnNEVzNpcjR5MzB6dytaL2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lNGLzNYbXBn?= =?utf-8?B?eExYYzIwWUxJaVQyZ1JGRWIzR1h3aWY0MWd0UlFpMWZGUVNSQ3FXUGJFbzVo?= =?utf-8?B?YnNFN2hRZnRBcEI2OVZqalQwK2JnWVdnOGhERjNXZDlUNlNYU0MrKzQ5Sy9P?= =?utf-8?B?NHplY29XR0ltd1J2eUcxaHN4WTFyMTZSK05mTlZtOEJXME5ZRFRKYkZ5SVYz?= =?utf-8?B?OG0rTEJveDJSV3FTZGdpb3IwdzMzYUFhNkdJbER0SVpSQWU5V0lBTTA5TTl3?= =?utf-8?B?WVBrUmVqQUhidm9BeFpIOVpKdkpaMFk1TGdkV2E5am40ZDRIQnlZTEt3QVFk?= =?utf-8?B?ejY1bGNwaUI5VWZSTldZamJJSldJdjdXU2lUZER2UUQ0ZHpUSURmL0p0VzM4?= =?utf-8?B?TnJxS2RqcVdtWk5HSjR0ZWpSYW1BcUVsUU9vdlY2ZUl3aXJaeHZ2d0UvemxM?= =?utf-8?B?U2R0T2xTbS9GSDZwZUExT1hIZm5FK1U3dVhBc0RMcHp2eUtHVHZ0eVFreTZM?= =?utf-8?B?S2xEeW5CQ3JoNi9BajFMSTJKN0lSMU1mRDRQYnZwVWJOcVkyOFJKN3p6MTZx?= =?utf-8?B?ek5hRDFLRTNCVmRkVWw1Q2VTZXY2VXk1L3NOWURKSlQ4bjdIL3JRZmdWVDE1?= =?utf-8?B?YmVIcHlXSlhUTWJaZnZUWitzNjNXZFk5akhubmpYU0Z0NERxUlI3ZUtHcHgz?= =?utf-8?Q?1Iz/wgJJZWlXsjye+LBmWCMHu?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2147560c-08a7-4bc3-da26-08dcf837f329 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9626.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Oct 2024 16:37:17.1292 (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: otaB2Zp4WQOoW+y9BqzNW3i79gnu3skGBNxiPKGXjh/zm0QS9B+aD1FitXE/6Im9l7ObNyFqL6jOH0toMYxrwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7577 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->v7 - 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