linux-arm-kernel.lists.infradead.org archive mirror
 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

* Re: [PATCH 1/1] Revert "clk: imx: use devm_platform_ioremap_resource() to simplify code"
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Leonard Crestez @ 2019-04-20 15:30 UTC (permalink / raw)
  To: Aisheng Dong, sboyd@kernel.org, shawnguo@kernel.org
  Cc: Peng Fan, Anson Huang, mturquette@baylibre.com, dl-linux-imx,
	kernel@pengutronix.de, Fabio Estevam, linux-clk@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org

On 4/19/19 1:42 PM, Aisheng Dong wrote:
> 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>

Tested-by: Leonard Crestez <leonard.crestez@nxp.com>
This revert fixes the main console on imx8qxp-mek

Instead of having imx8qxp-lpcg-adma map the whole ADMA subsystem a much 
better approach is to split LPCG into 64k areas each with their own DT 
node. Having so many clk provider nodes is unusual but it's an accurate 
description of 8qxp/8qm hardware.

The LPCG blocks were deliberately split in the SOC address space so that 
access to clk gating for individual peripherals can be controlled using 
the same kind of coarse-grained memory access control mechanisms used 
for the peripherals themselves.

Unfortunately this series has been hung for quite a while:
https://patchwork.kernel.org/project/linux-arm-kernel/list/?series=83525

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

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

* Re: [PATCH 1/1] Revert "clk: imx: use devm_platform_ioremap_resource() to simplify code"
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2019-04-22  2:03 UTC (permalink / raw)
  To: Aisheng Dong
  Cc: Anson Huang, sboyd@kernel.org, mturquette@baylibre.com,
	dl-linux-imx, kernel@pengutronix.de, Fabio Estevam,
	linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org

On Fri, Apr 19, 2019 at 10:42:51AM +0000, Aisheng Dong wrote:
> 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.

Dropped the offending patch.  Thanks for finding it.

Shawn

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

^ permalink raw reply	[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;
as well as URLs for NNTP newsgroup(s).