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.
Unified · Split
| @@ -241,6 +241,11 @@ static inline void __clocksource_update_freq_khz(struct clocksource *cs, u32 khz · 240 unmodified lines | ||
| 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 | |
| @@ -12,6 +12,10 @@ config CLOCKSOURCE_WATCHDOG · 11 unmodified lines | ||
| 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 |
| @@ -937,6 +937,8 @@ int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq) · 936 unmodified lines | ||
| 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 | |