public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/1] time/sched_clock: move sched_clock_register() out of .init section
@ 2025-04-04  5:05 Maxim Kochetkov
  2025-04-07  6:26 ` Thomas Gleixner
  0 siblings, 1 reply; 4+ messages in thread
From: Maxim Kochetkov @ 2025-04-04  5:05 UTC (permalink / raw)
  To: linux-kernel, linux-riscv, peterz, elver, namcao, tglx,
	samuel.holland, daniel.lezcano, apatel
  Cc: Maxim Kochetkov

The sched_clock_register() is widely used by clocksource timer
drivers. The __init prefix forces them to be initialized using
macro TIMER_OF_DECLARE with __init prefixed function.

Clocksource devices can be consumers of some external irq, clocks,
resets, e.t.c. Such devices can't be correctly probed if this
dependencies are provided by platform drivers. Because of regular
platform devices are not probed at this moment.

We can convert clocksource drivers to platform device drivers to
fix this issue, but __init prefix in sched_clock_register()
prevents it.

So lets drop __init prefix to allow platform device drivers to use
sched_clock_register().

Signed-off-by: Maxim Kochetkov <fido_max@inbox.ru>
---
 kernel/time/sched_clock.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c
index cc15fe293719..07f28e0e2716 100644
--- a/kernel/time/sched_clock.c
+++ b/kernel/time/sched_clock.c
@@ -174,8 +174,7 @@ static enum hrtimer_restart sched_clock_poll(struct hrtimer *hrt)
 	return HRTIMER_RESTART;
 }
 
-void __init
-sched_clock_register(u64 (*read)(void), int bits, unsigned long rate)
+void sched_clock_register(u64 (*read)(void), int bits, unsigned long rate)
 {
 	u64 res, wrap, new_mask, new_epoch, cyc, ns;
 	u32 new_mult, new_shift;
-- 
2.48.1


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

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

end of thread, other threads:[~2025-04-07 21:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-04  5:05 [PATCH 1/1] time/sched_clock: move sched_clock_register() out of .init section Maxim Kochetkov
2025-04-07  6:26 ` Thomas Gleixner
2025-04-07  7:25   ` Maxim Kochetkov
2025-04-07 21:11     ` Thomas Gleixner

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