Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clocksource: Provide clocksource_arch_init()

Architectures have extra archdata in the clocksource, e.g. for VDSO
support. There are no sanity checks or general initializations for this
available. Add support for that.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Andy Lutomirski <luto@kernel.org>
Acked-by: John Stultz <john.stultz@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Matt Rickard <matt@softrans.com.au>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: "K. Y. Srinivasan" <kys@microsoft.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: devel@linuxdriverproject.org
Cc: virtualization@lists.linux-foundation.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Juergen Gross <jgross@suse.com>
Link: https://lkml.kernel.org/r/20180917130706.973042587@linutronix.de

+11
+5
include/linux/clocksource.h
··· 241 241 __clocksource_update_freq_scale(cs, 1000, khz); 242 242 } 243 243 244 + #ifdef CONFIG_ARCH_CLOCKSOURCE_INIT 245 + extern void clocksource_arch_init(struct clocksource *cs); 246 + #else 247 + static inline void clocksource_arch_init(struct clocksource *cs) { } 248 + #endif 244 249 245 250 extern int timekeeping_notify(struct clocksource *clock); 246 251
+4
kernel/time/Kconfig
··· 12 12 config ARCH_CLOCKSOURCE_DATA 13 13 bool 14 14 15 + # Architecture has extra clocksource init called from registration 16 + config ARCH_CLOCKSOURCE_INIT 17 + bool 18 + 15 19 # Clocksources require validation of the clocksource against the last 16 20 # cycle update - x86/TSC misfeature 17 21 config CLOCKSOURCE_VALIDATE_LAST_CYCLE
+2
kernel/time/clocksource.c
··· 937 937 { 938 938 unsigned long flags; 939 939 940 + clocksource_arch_init(cs); 941 + 940 942 /* Initialize mult/shift and max_idle_ns */ 941 943 __clocksource_update_freq_scale(cs, scale, freq); 942 944