linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: imx8mp: register driver at arch_initcall time
@ 2022-09-28 12:41 Rasmus Villemoes
  2022-10-24 13:48 ` Rasmus Villemoes
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Rasmus Villemoes @ 2022-09-28 12:41 UTC (permalink / raw)
  To: Abel Vesa, Michael Turquette, Stephen Boyd, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team
  Cc: linux-kernel, linux-clk, Rasmus Villemoes

We have an imx8mp-based board with an external gpio-triggered
watchdog. Currently, we don't get to handle that in time before it
resets the board.

The probe of the watchdog device gets deferred because the SOC's GPIO
controller is not yet ready, and the probe of that in turn gets deferred
because its clock provider (namely, this driver) is not yet
ready. Altogether, the watchdog does not get handled until the late
initcall deferred_probe_initcall has made sure all leftover devices
have been probed, and that's way too late.

Aside from being necessary for our board, this also reduces total boot
time because fewer device probes get deferred.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
It would probably be reasonable to do the same to the other imx8m* clk
drivers, but I don't have any such hardware to test on.

 drivers/clk/imx/clk-imx8mp.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-imx8mp.c b/drivers/clk/imx/clk-imx8mp.c
index e89db568f5a8..9ddd39a664cc 100644
--- a/drivers/clk/imx/clk-imx8mp.c
+++ b/drivers/clk/imx/clk-imx8mp.c
@@ -734,7 +734,19 @@ static struct platform_driver imx8mp_clk_driver = {
 		.of_match_table = imx8mp_clk_of_match,
 	},
 };
-module_platform_driver(imx8mp_clk_driver);
+
+static int __init imx8mp_clk_init(void)
+{
+	return platform_driver_register(&imx8mp_clk_driver);
+}
+arch_initcall(imx8mp_clk_init);
+
+static void __exit imx8mp_clk_exit(void)
+{
+	platform_driver_unregister(&imx8mp_clk_driver);
+}
+module_exit(imx8mp_clk_exit);
+
 module_param(mcore_booted, bool, S_IRUGO);
 MODULE_PARM_DESC(mcore_booted, "See Cortex-M core is booted or not");
 
-- 
2.37.2


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

end of thread, other threads:[~2022-11-23  1:42 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28 12:41 [PATCH] clk: imx8mp: register driver at arch_initcall time Rasmus Villemoes
2022-10-24 13:48 ` Rasmus Villemoes
2022-10-24 14:00   ` Ahmad Fatoum
2022-10-24 14:31     ` Rasmus Villemoes
2022-10-27 23:29 ` Stephen Boyd
2022-10-31  9:15   ` Rasmus Villemoes
2022-11-07 13:54 ` Rasmus Villemoes
2022-11-19 20:45   ` Rasmus Villemoes
2022-11-19 21:38 ` Fabio Estevam
2022-11-19 21:57   ` Rasmus Villemoes
2022-11-19 22:02     ` Fabio Estevam
2022-11-21  9:44       ` Rasmus Villemoes
2022-11-21 10:59         ` Fabio Estevam
2022-11-21 12:29           ` Rasmus Villemoes
2022-11-21 12:48             ` Fabio Estevam
2022-11-21 15:43 ` Abel Vesa
2022-11-22  7:49   ` Rasmus Villemoes
2022-11-23  1:42     ` Stephen Boyd

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).