]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
clk: imx8qxp-lpcg: Warn against devm_platform_ioremap_resource
authorLeonard Crestez <leonard.crestez@nxp.com>
Mon, 9 Dec 2019 20:56:28 +0000 (22:56 +0200)
committerShawn Guo <shawnguo@kernel.org>
Wed, 11 Dec 2019 08:06:10 +0000 (16:06 +0800)
On imx8 the LPCG nodes map entire subsystems and overlap peripherals,
this means that using devm_platform_ioremap_resource will cause many
devices to fail to probe including serial ports.

Well-meaning but boot-breaking patches were posted multiple times so add
a comment explaining this issue.

Suggested-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/clk/imx/clk-imx8qxp-lpcg.c

index c0aff7ca6374c951537e669e8b970309f4e7e167..04c8ee35e14cdb5cf851253245cee3c7014dd7b1 100644 (file)
@@ -173,6 +173,17 @@ static int imx8qxp_lpcg_clk_probe(struct platform_device *pdev)
        if (!ss_lpcg)
                return -ENODEV;
 
+       /*
+        * Please don't replace this with devm_platform_ioremap_resource.
+        *
+        * devm_platform_ioremap_resource calls devm_ioremap_resource which
+        * differs from devm_ioremap by also calling devm_request_mem_region
+        * and preventing other mappings in the same area.
+        *
+        * On imx8 the LPCG nodes map entire subsystems and overlap
+        * peripherals, this means that using devm_platform_ioremap_resource
+        * will cause many devices to fail to probe including serial ports.
+        */
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res)
                return -EINVAL;