From patchwork Tue Jan 28 22:07:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13953234 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010038.outbound.protection.outlook.com [52.101.69.38]) (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 34FEC1F63E0 for ; Tue, 28 Jan 2025 22:08:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.38 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738102142; cv=fail; b=HapYs6qaWoe+5dA7zYmq5jFXAUCKwvFEvjchYU+9zBZVAJrHqgrfybxeC+a3GqTZdRY/EeF6GpxAc9vQaWmXmaL/pxBUF4qwC92/UT1UOK+8rPds+4RwChmCue9gN9tDAEQtpKDpdZjLEP6XEkJg39Yq/KU/Bphz+0pd/RDCXkY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738102142; c=relaxed/simple; bh=82i+ZNN//yWfCS+EdpjUgo+KbP9Mi5MxOEllPA4oVrY=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=iP02qOamBNQpxv5Ys0CyPzWIr19r28nHK6gCVi6oH8EDxh2aR9o29EvLKgBjVxwz+8HABojWcMUoZB1ScuPyPUs3ekQusLGeg8ffHubhKV6ixgkSxvhOShj47GSopE5O3tKGDvGHfEVbXQQS81rCsKP13cM7zaOnhrhM7YhFnDc= 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=Axiskoeq; arc=fail smtp.client-ip=52.101.69.38 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="Axiskoeq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aMpqn7BkZcTE21npsfJVTqSfsmr+iohkzsgxiF7Z2FVCHzvplczElqEiAOYTsO+3Y91TwcDtVsPG1fCqgxQvACc0TL8Ld2IJ/4r/E+2VjrTlxmOhe+ZQt1x49ItNWpqjHENqWbTSu+un250UEraAdy+2QhBIViio6hyYL73mMg52Bn6jzxwkPDWQWLVeJRxkfKGhCZjkT4OpUJssocy6eDptAifJCetFBV4OeBzEisgnTpOBlkeYi6uK7Fh3MScj9Pb/JvgXePY2v9qnFgs6HmuFQzT+Xfj8HbvzE+7i8c2JkAF3a1n8mSTJDskft3aZiwWKaa44vwTChvyguhYG1Q== 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=wJxChZP0aR0iCOpx4zJhPrHwj+xKeWc1Pssf1AAz6bQ=; b=AQ13e9UEqHhfdm2wHNiWle+wL1YlnnUV4X5xgaVugPMchGnunnOX1zWJ2PigRomgwSPNPD9ygghAqhsuUXAkw7coDsrRbLxDBmIfavCJfDDmG9IIh/JuTqzslFR7FVskuwGf40SAdzgVGgTJ3E5QLJ6m8c83JnnUQ6vg9UZdY6SIe+koN2jk0ItWecMpDtkBXc2lGgKyAY7Mx80udn4giL0pvSRjbAPB+I8mEFLl8BCl+jlkNNRpWm+FypxKj/FYcxc4jspB5jvU/vVxrydwBl0xP/A1FlIaYuww8I2RUvylbfkZnLXR1M943SJNAWvDY5KFgfNliWmrAy4recb1oQ== 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=wJxChZP0aR0iCOpx4zJhPrHwj+xKeWc1Pssf1AAz6bQ=; b=AxiskoeqDB97aktKh6nD3CJ4FlxjCwoc6VvgzSPnwKIsQbydcWE9z+XJA44tzk1BFUyHiUuzLSKbKnFMKm1Yg+otaG+evIJiMdIEKQuUSnB7T9H6O4ysAOci5ciDtUdg9hqp4NRT82pldMay3HSmCB1T6JtZBdZ6QUHTVQimkuxV/LcU+mrNwgpKVvvcmnJ/QyPsoHM9ugd7qzDkAq6r2CEeZLbwMrAhOp0JL/jTjw6uKdTSvsKRW0rZ/UGB6sxUS6tBjhBJ6AXftQfgN2OTJgrxW+KAga/+Ev5knn0wGTQU2iIJMv8a22D2ZEb3zBvgNbxk1Ou5xK82TOR0c1crGQ== 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 AM9PR04MB8555.eurprd04.prod.outlook.com (2603:10a6:20b:436::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.18; Tue, 28 Jan 2025 22:08:58 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%5]) with mapi id 15.20.8377.021; Tue, 28 Jan 2025 22:08:58 +0000 From: Frank Li Date: Tue, 28 Jan 2025 17:07:40 -0500 Subject: [PATCH v9 7/7] PCI: imx6: Remove cpu_addr_fixup() Message-Id: <20250128-pci_fixup_addr-v9-7-3c4bb506f665@nxp.com> References: <20250128-pci_fixup_addr-v9-0-3c4bb506f665@nxp.com> In-Reply-To: <20250128-pci_fixup_addr-v9-0-3c4bb506f665@nxp.com> To: Rob Herring , Saravana Kannan , Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=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, Niklas Cassel , Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1738102099; l=2187; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=82i+ZNN//yWfCS+EdpjUgo+KbP9Mi5MxOEllPA4oVrY=; b=jKJZ1FU69RghE7E2Y6Mg+P7Z+iK7AD42u2G9MBdt+1uL9MlogqwTnSfIaN0OhtJtZ+XLNgYdk eU1OWZGSxQ8B69FI0yYwhxT+y4v0+rvQjnMqSY3Xcg3mibWPpph1lcL X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR03CA0130.namprd03.prod.outlook.com (2603:10b6:a03:33c::15) 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_|AM9PR04MB8555:EE_ X-MS-Office365-Filtering-Correlation-Id: de8aa5f3-d534-488f-0cf2-08dd3fe85cd6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|376014|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?oZIrtPNjG+h8Sas1TK9TdQvE/0TY2bm?= =?utf-8?q?7SPSwkzIvhtkPcZ4eqkVsy/gyC0gm1vrfTo9PpsAxe6dt4jKOHHNgpukdp7RJ9K3X?= =?utf-8?q?bnExjitIiwJKy3UfAPIZzM3LfMufhJ92LAF8REDM91JOukPi2N4JQDeH4kLNs3I+1?= =?utf-8?q?wU2nmYBw769wbIiyUX7SSk0uL1TJT5W4o8vnsdO6m0Sxt0Zq7zWsWThnT8E0DrTos?= =?utf-8?q?qqS9dAVyu7DGBjgR1wfyazsG9pjlsWS4NHKaVEFGLPoACZOcWrWAmXjdtu4rjMsEF?= =?utf-8?q?gURRfOqdgaqz0SkFtDrNL88Vj2ou0h1encjbSJBrgy4CUPAtutMz++q3ljuLDmSea?= =?utf-8?q?i7Dr3YUH7DXgJ9i4Cz6Et0QMbbLINQERhfwYg2ykrEOOQXtHeGH1wN1l3if2eQws4?= =?utf-8?q?ysWeksdg+wAjh/32WkFfOYnk5jIqbanwSjbqbOoO33ZJQiG5RrrEy8LkUJVjXx/Xv?= =?utf-8?q?qpe/s2GBV+LinVB6kwZAa0HCRwK/oh/a20En4ipSKgFU9ttdVtz1YZBMFGgleD/W6?= =?utf-8?q?cKjFSoIdH9I0YYd4dE+f7JkeE1VHuXy7RvaXLjlZV9GMyTBg6aTNyQoBotq0f3QBd?= =?utf-8?q?x0fY9+1+wql8ZcwqFIj6tncTEzpNReVcyvNZNRE6veswKrjljTfbcctIWtQALL+//?= =?utf-8?q?7508mo9mCPM6r8LqQPwKqdDZpqslH4PsIeCFb2N5jyMXCK12m/SA2DtVrhQtw2R2j?= =?utf-8?q?lRRAtMTNqoKme5qgObkhzrCDYRDFoastx3ExKJ73aOvNoeLtG77sHEL82rjEu8fEW?= =?utf-8?q?vcCV7aXBXx7PrYBS6O2zunBOfLfEBrDsRC28KgZjS0kPhT4Jr2SiQsWnr3EhsF3p0?= =?utf-8?q?YKIu0ik/23mCPyPZt77aUBQ6o43Jg1PQ8n64ez9e7RRyJ+XqUygqnGsOiKxuWwZ7r?= =?utf-8?q?pI7HjowVmyibRYLJtncV21fCnpVYk9nQYaHxoRYnJjJ7MYYf2cTehSkouHh23D5rd?= =?utf-8?q?rLoGzBEd/w04jM8nos7wOK8mITpqMEwdebUmdVBeQeoeK5a9yxPiwtJoFtm1v4tys?= =?utf-8?q?78Rwbstg0LsOQwDKeLd1kmRu+Fefa9XxUNSeMxefO7IOp/9Lta5b++xdRgksxvcs0?= =?utf-8?q?+M+yMnZnlRyH/89r/+I2czlxfmp1Xhd6vfQOoLPldCx1iGUEgXXOQELsvq+2Fo16E?= =?utf-8?q?oQ1OpJZ8bj5SkXodKkf+U7/aTRBezi3Sa0BVs+sDeiS9kRXWXwUM036Wxgxwtr071?= =?utf-8?q?UF3ftPX4SGSZOuTjK3jV6N6IIhW2tGjbeetueKR0XCsC5hksYzPciRgwdhpfhtzOH?= =?utf-8?q?TD5vtp6ROFyBsVoE3HvhB+J4IR/4PgloJgpATMZmdIGE7hi6oE+MEFG8kJXbIZpU9?= =?utf-8?q?ZcotIbdo7m0PwIeUsqLSCV/P/E3S08BX23jxBSvl8lLqwqucxZc4DNR3nDubsa1yr?= =?utf-8?q?Y8j6QESEybZ?= 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)(376014)(52116014)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?S6XfjwPpJG9LrnGmFyPCmdDtaCPg?= =?utf-8?q?S8C8aJWYyLAJHX5/1wxEe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EQ89A4QQ8li0lpHF+W6+Rw6Kp?= =?utf-8?q?CqCw9NO43y9dTlNzWyWuKPxpBHaj/TY4xJD1Yx4iTF8uhichMPqaFaKKV3vV3X+r0?= =?utf-8?q?GlgP4o5rs2KiHE1inKGYND5xgjuIx2KhEeRfR7l7bqYu0bm8ni0YihdslTPpPsON2?= =?utf-8?q?DIZIxwu6ui1JCZ8VQkMgg6OCwAEKV1yRgLdom+a8PbuVLxCSr6XmuEnFsUHMfmodM?= =?utf-8?q?MGgMJR3xafoUHFmjDo9t+WHiEcSo+khjQRBXJR393fMy8aKu8SiNWECg/5iz2fSRG?= =?utf-8?q?IOU/xM/M5QUvPRcDFqfmsubr2AwupzuavWEAPdQVKig/UhNPUyLzBHZfULGpii/qs?= =?utf-8?q?iS93GoR6n1Gi1wc/bDSX6rqRgG1jCY/bdQ63QXc/azD1C/xPSYG17IME2gm9N9fNo?= =?utf-8?q?qSoPUlTeLJHzX+OPKuoUaufw6l2H1WSXIBBCMyY4xrjpn2JeqCRBcM9Br/X8EyULQ?= =?utf-8?q?VFCmC/LantzFkslFaUe/lFacg/utxpngVHBX31rNjptRY/kBla5YgjJLQb4kVAMuv?= =?utf-8?q?oKsMyR51zZi1dRIwfIzW9jyDIBRVdhPBcskNr9QJxpp9dD4GDzbpaKc7qcBBnbXMC?= =?utf-8?q?MdtPo11xHEra?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: de8aa5f3-d534-488f-0cf2-08dd3fe85cd6 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2025 22:08:57.9884 (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: WNO/bMXQFSN5Uc364JWnaC2psUsS3lraKRk4gHXfqqjJ5xTi0g+GqLOQ5RBBRzOsCAC3QXzF+k1pgusLiGkw0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8555 Remove cpu_addr_fixup() because dwc common driver already handle address translate. Acked-by: Richard Zhu Reviewed-by: Manivannan Sadhasivam Signed-off-by: Frank Li --- Change from v8 to v9 - rebase latest linux-next (close enough to v6.14-rc1) Change from v7 to v8 - add mani and richard's review/ack tag - use varible 'use_parent_dt_ranges' Change from v2 to v7 - none Change from v1 to v2 - set using_dtbus_info true --- drivers/pci/controller/dwc/pci-imx6.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 90ace941090f9..d1eb535df73e1 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1217,22 +1217,6 @@ static void imx_pcie_host_exit(struct dw_pcie_rp *pp) regulator_disable(imx_pcie->vpcie); } -static u64 imx_pcie_cpu_addr_fixup(struct dw_pcie *pcie, u64 cpu_addr) -{ - struct imx_pcie *imx_pcie = to_imx_pcie(pcie); - struct dw_pcie_rp *pp = &pcie->pp; - struct resource_entry *entry; - - if (!(imx_pcie->drvdata->flags & IMX_PCIE_FLAG_CPU_ADDR_FIXUP)) - return cpu_addr; - - entry = resource_list_first_type(&pp->bridge->windows, IORESOURCE_MEM); - if (!entry) - return cpu_addr; - - return cpu_addr - entry->offset; -} - /* * In old DWC implementations, PCIE_ATU_INHIBIT_PAYLOAD in iATU Ctrl2 * register is reserved, so the generic DWC implementation of sending the @@ -1263,7 +1247,6 @@ static const struct dw_pcie_host_ops imx_pcie_host_dw_pme_ops = { static const struct dw_pcie_ops dw_pcie_ops = { .start_link = imx_pcie_start_link, .stop_link = imx_pcie_stop_link, - .cpu_addr_fixup = imx_pcie_cpu_addr_fixup, }; static void imx_pcie_ep_init(struct dw_pcie_ep *ep) @@ -1645,6 +1628,7 @@ static int imx_pcie_probe(struct platform_device *pdev) if (ret) return ret; + pci->use_parent_dt_ranges = true; if (imx_pcie->drvdata->mode == DW_PCIE_EP_TYPE) { ret = imx_add_pcie_ep(imx_pcie, pdev); if (ret < 0)