[PATCH v3 3/8] clocksource: allow re-init for same clock

Stefan Kerkmann s.kerkmann at pengutronix.de
Mon Aug 17 07:01:14 PDT 2026


A clocksource might need to be re-initialized if fundamental parameter
changes e.g. the clock frequency. With the change the init sequence
which sets the global clocksource can be called unconditionally again
for the same clock.

Signed-off-by: Stefan Kerkmann <s.kerkmann at pengutronix.de>
---
 common/clock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/clock.c b/common/clock.c
index 87109f3efc..fc770ac853 100644
--- a/common/clock.c
+++ b/common/clock.c
@@ -216,7 +216,8 @@ void clocksource_srand(void)
 
 int init_clock(struct clocksource *cs)
 {
-	if (current_clock && cs->priority <= current_clock->priority)
+	if (current_clock && cs != current_clock &&
+	    cs->priority <= current_clock->priority)
 		return 0;
 
 	if (cs->init) {

-- 
2.47.3




More information about the barebox mailing list