History

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.

Thomas Gleixner committed 8 years ago

Commit d67f34c1 parent 02e42563 files · +11 −0Browse files

Unified · Split

3 files
  1. include/linux/clocksource.h +5 −0
  2. kernel/time/Kconfig +4 −0
  3. kernel/time/clocksource.c +2 −0
include/linux/clocksource.h+5−0
@@ -241,6 +241,11 @@ static inline void __clocksource_update_freq_khz(struct clocksource *cs, u32 khz · 240 unmodified lines
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
kernel/time/Kconfig+4−0
@@ -12,6 +12,10 @@ config CLOCKSOURCE_WATCHDOG · 11 unmodified lines
12config ARCH_CLOCKSOURCE_DATA12config ARCH_CLOCKSOURCE_DATA
13 bool13 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 last19# Clocksources require validation of the clocksource against the last
16# cycle update - x86/TSC misfeature20# cycle update - x86/TSC misfeature
17config CLOCKSOURCE_VALIDATE_LAST_CYCLE21config CLOCKSOURCE_VALIDATE_LAST_CYCLE
kernel/time/clocksource.c+2−0
@@ -937,6 +937,8 @@ int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq) · 936 unmodified lines
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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t