diff options
author | 2020-02-07 13:38:55 +0100 | |
---|---|---|
committer | 2020-02-17 14:40:23 +0100 | |
commit | 5d51bee725cc1497352d6b0b604e42a90c680540 (patch) | |
tree | 739d7486c2bd860a038c8b8ef2d05a75cfd14ede /kernel/time/clocksource.c | |
parent | x86/vdso: Move VDSO clocksource state tracking to callback (diff) | |
download | linux-5d51bee725cc1497352d6b0b604e42a90c680540.tar.gz linux-5d51bee725cc1497352d6b0b604e42a90c680540.tar.bz2 linux-5d51bee725cc1497352d6b0b604e42a90c680540.zip |
clocksource: Add common vdso clock mode storage
All architectures which use the generic VDSO code have their own storage
for the VDSO clock mode. That's pointless and just requires duplicate code.
Provide generic storage for it. The new Kconfig symbol is intermediate and
will be removed once all architectures are converted over.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lkml.kernel.org/r/20200207124403.028046322@linutronix.de
Diffstat (limited to 'kernel/time/clocksource.c')
-rw-r--r-- | kernel/time/clocksource.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 428beb69426a..7cb09c4cf21c 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -928,6 +928,15 @@ int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq) clocksource_arch_init(cs); +#ifdef CONFIG_GENERIC_VDSO_CLOCK_MODE + if (cs->vdso_clock_mode < 0 || + cs->vdso_clock_mode >= VDSO_CLOCKMODE_MAX) { + pr_warn("clocksource %s registered with invalid VDSO mode %d. Disabling VDSO support.\n", + cs->name, cs->vdso_clock_mode); + cs->vdso_clock_mode = VDSO_CLOCKMODE_NONE; + } +#endif + /* Initialize mult/shift and max_idle_ns */ __clocksource_update_freq_scale(cs, scale, freq); |