aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/clocksource.h5
-rw-r--r--kernel/time/Kconfig4
-rw-r--r--kernel/time/clocksource.c2
3 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 308918928767..6e6b86f9046d 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -241,6 +241,11 @@ static inline void __clocksource_update_freq_khz(struct clocksource *cs, u32 khz
241 __clocksource_update_freq_scale(cs, 1000, khz); 241 __clocksource_update_freq_scale(cs, 1000, khz);
242} 242}
243 243
244#ifdef CONFIG_ARCH_CLOCKSOURCE_INIT
245extern void clocksource_arch_init(struct clocksource *cs);
246#else
247static inline void clocksource_arch_init(struct clocksource *cs) { }
248#endif
244 249
245extern int timekeeping_notify(struct clocksource *clock); 250extern int timekeeping_notify(struct clocksource *clock);
246 251
diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig
index 78eabc41eaa6..58b981f4bb5d 100644
--- a/kernel/time/Kconfig
+++ b/kernel/time/Kconfig
@@ -12,6 +12,10 @@ config CLOCKSOURCE_WATCHDOG
12config ARCH_CLOCKSOURCE_DATA 12config ARCH_CLOCKSOURCE_DATA
13 bool 13 bool
14 14
15# Architecture has extra clocksource init called from registration
16config ARCH_CLOCKSOURCE_INIT
17 bool
18
15# Clocksources require validation of the clocksource against the last 19# Clocksources require validation of the clocksource against the last
16# cycle update - x86/TSC misfeature 20# cycle update - x86/TSC misfeature
17config CLOCKSOURCE_VALIDATE_LAST_CYCLE 21config CLOCKSOURCE_VALIDATE_LAST_CYCLE
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 0e6e97a01942..ffe081623aec 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -937,6 +937,8 @@ int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
937{ 937{
938 unsigned long flags; 938 unsigned long flags;
939 939
940 clocksource_arch_init(cs);
941
940 /* Initialize mult/shift and max_idle_ns */ 942 /* Initialize mult/shift and max_idle_ns */
941 __clocksource_update_freq_scale(cs, scale, freq); 943 __clocksource_update_freq_scale(cs, scale, freq);
942 944