public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: clk-imx8mm: Initialize clocks in arch_initcall
@ 2026-04-08 10:13 Paul Geurts
  2026-04-08 10:21 ` Ahmad Fatoum
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Paul Geurts @ 2026-04-08 10:13 UTC (permalink / raw)
  To: abelvesa, peng.fan, mturquette, sboyd, Frank.Li, s.hauer, kernel,
	festevam, shawnguo, linux-clk, imx, linux-arm-kernel,
	linux-kernel
  Cc: martijn.de.gouw, Paul Geurts

The i.MX8MM clock driver is implemented as module_platform_driver();,
which makes it initialize in device_initcall(). This means that all
drivers referencing the clock driver nodes in the device tree are
deferred by fw_devlink, which are most of the i.MX8M platform drivers.

Explicitly initialize the clock driver in arch_initcall(), to make sure
the clock driver is ready when the rest of the drivers are probed.

Fixes: af7e7ee0e428 ("clk: imx8mm: Switch to platform driver")
Signed-off-by: Paul Geurts <paul.geurts@prodrive-technologies.com>
---
 drivers/clk/imx/clk-imx8mm.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c
index 319af4deec01..7b2cf867b920 100644
--- a/drivers/clk/imx/clk-imx8mm.c
+++ b/drivers/clk/imx/clk-imx8mm.c
@@ -636,7 +636,19 @@ static struct platform_driver imx8mm_clk_driver = {
 		.of_match_table = imx8mm_clk_of_match,
 	},
 };
-module_platform_driver(imx8mm_clk_driver);
+
+static int __init imx8mm_clk_init(void)
+{
+	return platform_driver_register(&imx8mm_clk_driver);
+}
+arch_initcall(imx8mm_clk_init);
+
+static void __exit imx8mm_clk_exit(void)
+{
+	platform_driver_unregister(&imx8mm_clk_driver);
+}
+module_exit(imx8mm_clk_exit);
+
 module_param(mcore_booted, bool, S_IRUGO);
 MODULE_PARM_DESC(mcore_booted, "See Cortex-M core is booted or not");
 
-- 
2.39.2


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

end of thread, other threads:[~2026-04-09 13:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-08 10:13 [PATCH] clk: clk-imx8mm: Initialize clocks in arch_initcall Paul Geurts
2026-04-08 10:21 ` Ahmad Fatoum
2026-04-09  9:16   ` Paul Geurts
2026-04-09 11:34     ` Ahmad Fatoum
2026-04-09  6:51 ` Peng Fan
2026-04-09  9:29   ` Paul Geurts
2026-04-09 13:54 ` Abel Vesa

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