public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Revert "clk: imx: use devm_platform_ioremap_resource() to simplify code"
@ 2019-04-19 10:42 Aisheng Dong
  2019-04-20 15:30 ` Leonard Crestez
  2019-04-22  2:03 ` Shawn Guo
  0 siblings, 2 replies; 3+ messages in thread
From: Aisheng Dong @ 2019-04-19 10:42 UTC (permalink / raw)
  To: linux-clk@vger.kernel.org
  Cc: Aisheng Dong, Anson Huang, sboyd@kernel.org,
	mturquette@baylibre.com, dl-linux-imx, kernel@pengutronix.de,
	Fabio Estevam, shawnguo@kernel.org,
	linux-arm-kernel@lists.infradead.org

This reverts commit 612d5b65894b5b1607a004bd9bc60d5963b58ef6.

Originally we use devm_ioremap() specifically because we want to bypass
the devm_request_mem_region due to LPCG address space are shared with
some other modules within the same SS (subsystem).

The patch in question occasionally added the request_me_region back
by calling devm_platform_ioremap_resource which results in all the devices
with overlappded IO space failed to be probed as follows:

[    1.062996] fsl-lpuart 5a060000.serial: can't request region for resource [mem 0x5a060000-0x5a060fff]
[    1.071923] fsl-lpuart: probe of 5a060000.serial failed with error -16

Cc: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
Shawn,

This is a new issue and only exist in imx/for-next branch.
You can decide whether to remove it or take the revert patch.
---
 drivers/clk/imx/clk-imx8qxp-lpcg.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-imx8qxp-lpcg.c b/drivers/clk/imx/clk-imx8qxp-lpcg.c
index c711654..fb6edf1 100644
--- a/drivers/clk/imx/clk-imx8qxp-lpcg.c
+++ b/drivers/clk/imx/clk-imx8qxp-lpcg.c
@@ -159,6 +159,7 @@ static int imx8qxp_lpcg_clk_probe(struct platform_device *pdev)
 	struct clk_hw_onecell_data *clk_data;
 	const struct imx8qxp_ss_lpcg *ss_lpcg;
 	const struct imx8qxp_lpcg_data *lpcg;
+	struct resource *res;
 	struct clk_hw **clks;
 	void __iomem *base;
 	int i;
@@ -167,7 +168,10 @@ static int imx8qxp_lpcg_clk_probe(struct platform_device *pdev)
 	if (!ss_lpcg)
 		return -ENODEV;
 
-	base = devm_platform_ioremap_resource(pdev, 0);
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res)
+		return -EINVAL;
+	base = devm_ioremap(dev, res->start, resource_size(res));
 	if (!base)
 		return -ENOMEM;
 
-- 
2.7.4

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-22  2:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-19 10:42 [PATCH 1/1] Revert "clk: imx: use devm_platform_ioremap_resource() to simplify code" Aisheng Dong
2019-04-20 15:30 ` Leonard Crestez
2019-04-22  2:03 ` Shawn Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox