From patchwork Fri Nov 1 07:06:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongxing Zhu X-Patchwork-Id: 13858829 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5DB84E674A8 for ; Fri, 1 Nov 2024 07:05:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=v3sL1r5PmjJpnf6mp1AfaQeR0TiNGX3bScEnLTP2+Uo=; b=sHCHxh48V8xLDzkIa+M9kveYJ1 Fcw26uBzLBMP8V6RKVUTK5FHBsrcY5WqGBUFNwLTEZJ61IKauKO5lpBuUb8QF+nEM5SwpPibNKCWt J8aemGVFhaRzEJD0e+b5+PEBqDBTi/cV3Ei8w0v6eiZ3WsvAMcUXR6bxiD5Yx3poThNPq2Fo4xBCu xc+XJwKyDS/Fz06s9V+lGNyeSt3VT4iElter4K/4NckTv4gpYRCV6X5QKPX6iQ4QwXaJhP9zfpkjY 8Yv2fTomdFNADwbH186Q3m+7QnM6K7YmpAQJ5DJf8djzXwMkBwOnqaQJHnG8CUyJJRmQEJ+4hSLJu wVEZb5eQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t6liA-000000062uF-2ok2; Fri, 01 Nov 2024 07:04:46 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6laP-000000061eU-0qfE for linux-arm-kernel@bombadil.infradead.org; Fri, 01 Nov 2024 06:56:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=v3sL1r5PmjJpnf6mp1AfaQeR0TiNGX3bScEnLTP2+Uo=; b=WiHZw/aGYI1aoFA4xcpWMeTye1 Fj3HdG+GhN0F08Oa2zeFz4z2PLAIkSsStP+CPZsLDyl51Ys7mSTefDTBYyonvZt4v+Nfchs0Nx1Gd ESQPY/S0fkvZZdS8C6etjgaZ0BAa6p/HOGrH/tLn6owa9DEqJoGjhRi+raFUOptpo7nix0eJNyOiK GIWXuAllHwiJywIczUcgJ70QM6iGnrZvVdQFjdxFhKzjwdgNpkQ6nlo1Fi/W2H5irU7pTV+UnHfFR mtR8OfVliwoIZQoLEG6KSOv/yceia8KfKIYLFr9jUvBkjN0Q5tgBf6NjsMZ2+UZDwCs5QaEWaJfG3 LXCOx0Wg==; Received: from mail-vi1eur05on20622.outbound.protection.outlook.com ([2a01:111:f403:2613::622] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t6laG-0000000AdCq-32Pz for linux-arm-kernel@lists.infradead.org; Fri, 01 Nov 2024 06:56:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qIz7ZVfqtSRpYr5XZG/vKLsYcVftZlKgJLcY1xQz9eSsW/Ifdq8prnNzzMKlC/9qWbUnrhIpbbQr911se5cYrGAsFk0JULT7HveEqbcspQBS24qFq3IXuhdkfgjaMrU5ajB0q6DueTCoe9Yn0Ts7yhCg45AVHLqKibPTnvbTW+aF39bDn8bJ6jmCKPyK7QW+90Gqhy/EgkNrDw8Nw17uSwCh7ScRcVTq3+PMPnlGNx37eMaxnfeDrS55r3yiL/Flbsg5oXPcnJuXsziL0PbPzIzYj8KVN58ZS2Z17pC8WYvi/l+0/cGW9BfvqSW2n8HdKvqd2Y3C69sn7wv7foMFxQ== 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=v3sL1r5PmjJpnf6mp1AfaQeR0TiNGX3bScEnLTP2+Uo=; b=ER+lSBF3r3aCMTgyKiAEEiEDLMTxhcArbgpKjyOK5r35dNquyg2aWJNJi9aD09/VVxy2Ku53r7jn3I8NxVve8qyrCtQw0QJin4ZdU5SESm66X6N/rM/wdkgr1ZZASX8lXF7jdtR2YQ9BhqUV1V7HxiqY6ezUx4QsAKOvN3aMFfVgdAGYVI6mEfvGVz0b0rbTF/AJogsvE9kCxrua/ZMJXNNgLXvJxFyJ3Ordafo23BY5WbVapfKvFqI1ncolY+fSNvydMqZ62FdA8kiQUIlrYQ5UelvLrCNcTyHoG147bYcusXuEWcj09WJVKk8f/INvnV79XAolsy8ZO4SU1hS+Fw== 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=v3sL1r5PmjJpnf6mp1AfaQeR0TiNGX3bScEnLTP2+Uo=; b=O2YIUVuHjNJo/dwhBnaMvXjoWLjfN6ngTIBDjeiQji2fjyJ357qgcYlqtvQzMrlEDsRV6D1YRE8lSC332z6KZa+grD27PZDN43kguNkWVXacozhjxxAsbPmwgiDXFx63AoJAfSv6Dqswt0qFyH2O605+raZY06D/HcH0BhCR01AGJdRXQ0mM779B3SCdx3FDpDPfBU/pj1HhOxs6eeEhDJeqnksjSonf3tX1a82d7S0fdCrwDJP3T9qgG6a6ByWuuK/2HwnyDj1WonfWeiQP7CFRO9neloo0/0qMqohpXkdRUBhAML9xoIgk2kcxxYV18Kt4tEtCSO4uejst3BlCww== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) by PAXPR04MB8573.eurprd04.prod.outlook.com (2603:10a6:102:214::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Fri, 1 Nov 2024 06:56:32 +0000 Received: from AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93]) by AS8PR04MB8676.eurprd04.prod.outlook.com ([fe80::28b2:de72:ad25:5d93%6]) with mapi id 15.20.8114.015; Fri, 1 Nov 2024 06:56:32 +0000 From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, lpieralisi@kernel.org, kw@linux.com, manivannan.sadhasivam@linaro.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org, frank.li@nxp.com, s.hauer@pengutronix.de, festevam@gmail.com Cc: imx@lists.linux.dev, kernel@pengutronix.de, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Zhu , Frank Li Subject: [PATCH v6 04/10] PCI: imx6: Correct controller_id generation logic for i.MX7D Date: Fri, 1 Nov 2024 15:06:04 +0800 Message-Id: <20241101070610.1267391-5-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20241101070610.1267391-1-hongxing.zhu@nxp.com> References: <20241101070610.1267391-1-hongxing.zhu@nxp.com> X-ClientProxiedBy: SI1PR02CA0017.apcprd02.prod.outlook.com (2603:1096:4:1f4::10) To AS8PR04MB8676.eurprd04.prod.outlook.com (2603:10a6:20b:42b::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8676:EE_|PAXPR04MB8573:EE_ X-MS-Office365-Filtering-Correlation-Id: 63c4728a-7d60-4744-5d19-08dcfa425157 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|376014|7416014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: WBxNbgvDm9eQHwE5xIbELQBVo52tXjXUOQQtFictzAhyMH3GCLz36us9kcywXGvVHlXS1ovANgLRVj287aYtKtNzKj5j4XdZQaxn/RA02mYv/YhH/XVFkhPeOtsYznSADY9Xg/1DuiAwJW0adiV9tkvgMaFpiWFCTgdq77Dqcdc8Zb4OtakoCecVk1y7aH+hHs62gONuxAKBG0v/SHd8dwmGMGqlPKW/qwaXeXqYNirmwDd4FNQCYI+2HSX7bCpkGz5vdWjAQ9vtWQ5Wt5m4F/zuxziMAjoRmGrd+U1I7RPjWLjoux4rqufrzOX4Rr1UZeidjQ7GNKSXg99fQ6crbUHL+lN6lk6qyLk2/PSHW5KjHBQXXRvdMGZa7MngA73Dw7/75pEV3/zXgaRqe7c/vJkd0hdpdEvZtMGhEJLmqV5E25xkeZr969R6g2F5lFr4fs8T4D2Tm+lwWua4f0mw8xVxCLJtXTzFln0CDk6rIpT2L8ow2h50OtVmeHbRxEJ/p38LqxRnTdV4nF/7gDMHJX0tCoBJpX9gJE8DATXwe703ThhfiwHJmzO+vGtFCxayINBfvFpTuoy8kdfZbWiBYtfUBu83+NUwm0z9zQ0fa1/6ZjWpUoie3Ug7SHslvgta2f70PR05ceEN9vNOoNBmH0/MkbOseiKHcL321JJlaWjT3gmndeoFL6+R8702qh/kBtv/dkVoMqRQ7YbswETulhtLichG0gZSmx7jKHWLZdR9r8cDAjImOsswHy38zPbdkPMxUAapQ4kUDidQfBAwm3IJNKgvLgh5p5lkwhxcl36ppRPEHQI8o/anwme/fOLNKAs+MbwkME1pqamo6Qq4k5ENmw+VgEj8gqyLqxB0G22KbNmjXubWqiDD665XoKwkivJmHNfnUomaTHwnkQEJH8HrHv5wFderFx1dDHvRnMWv0hyZAiJ41uz1Wu/5Yzzbz/jYtMm3mK0arDkoSc2pvNDkU6fLIGtMEWgKI8yORmWZPIsxknHMkH3CEicvGArkpmY7GAcjVXifxyROJ0hNtteJ9+1kqUAoeg4IIDaMNqj86N3FgPxzxaHOshZTjoT7DkDJGWzXre9utpJDvjcJb7eSmET9hW7AJMML2LH6KPUqVkzfUChpTn/Mq3EgmmCQvQ/Oq3vdK01ClFxVP/HM4GhMpLwTjy/RMZY3z7xPZnSti7HpZDElZu1ngBqDrCSR/QomIM8ygw7Y/woJxVj+i2CwaXnIqN9VJIWjG3qNFM6Z09FqeXSw8uejJg1lYVs6W2UeF4nMg8rFjJatBerL0ugEqQjmzPTr1fsppzcAHsVV9utKOhkd8AwG+SbiaZjoCFC4JkYkMKiVcH3eiyDju7F6LbzRxzhKBKC6kQ4h32qI6fyXaV1i+0btuHwPjTSL X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8676.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(52116014)(376014)(7416014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2l+1viStw/9GXSeSI9WxTgyrCR/4rDOSnIDYKoEBHluRuXdTeFUNx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lL1n88C4MqB4pZh+lsQ5NwViup2E7BpHNPRGRKzjzjFZIH3P608jHl1WH4Wgz0V+2CmC6J2tJECfHLeQg2XP7Qo8OwunIftXjNandd1xiGh2uJHU/bKg1oX+BfehCPCOzuQgcazo7JlhijT+2AIbUlJnMQ9gGJU7BTs1OTI6aIa9m8m4iF06hL69+hyH9SzdSlwa9QBw6CzcqfLJl5lnWE8GI41a7fC6QxQF38UxC3YoXCzK7TWuMmSUv22Twb015n5LQtPbElPOjr8DH+q+EXxct2EkaZanvQwp0irZPFcgqowO/unRjUUQGdVfMyK62t0IbaOI6O1tEBI745uSe54EAZBQepP7Tg2D67bphcR564IsYmAZmqDLAXbmnJF69o7MPC6RXSWTWKdNuaYNrh6XDy4h2wKPFRlNRLG4/x0GDSRY5p6E8QnTGP3NZGbqS3DT2Hfy9DDiVkqJ3ZID5drep7t X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63c4728a-7d60-4744-5d19-08dcfa425157 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8676.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2024 06:56:32.2581 (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: SwLWsl2JEdKAdXBUb5tS6bNfvWcQG+JJHGekjAZA5EZKvmSsaGo2i9+v3zFk5GWfw0z6hfARCtStqNlLkJv7Xw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8573 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241101_065640_350955_D4DC8409 X-CRM114-Status: GOOD ( 14.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org i.MX7D only has one PCIe controller, so controller_id should always be 0. The previous code is incorrect although yielding the correct result. Fix by removing IMX7D from the switch case branch. Signed-off-by: Richard Zhu Reviewed-by: Frank Li Reviewed-by: Manivannan Sadhasivam --- "This is just *wrong*. You cannot hardcode the MMIO address in the driver. Even though this code is old, you should fix it instead of building on top of it. - Mani" IMX7D here is wrong athough check IMX8MQ_PCIE2_BASE_ADDR is not good method. Previously try to use 'linux,pci-domain' to replace this check logic. Need more discussion to improve it and keep old compatiblity. Let's fix this code error firstly. --- drivers/pci/controller/dwc/pci-imx6.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 462decd1d589..996333e9017d 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1342,7 +1342,6 @@ static int imx_pcie_probe(struct platform_device *pdev) switch (imx_pcie->drvdata->variant) { case IMX8MQ: case IMX8MQ_EP: - case IMX7D: if (dbi_base->start == IMX8MQ_PCIE2_BASE_ADDR) imx_pcie->controller_id = 1; break;