diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index bb58c9c1979a..683c2fe00ab3 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1277,7 +1277,7 @@ config HAVE_ARM_ARCH_TIMER depends on CPU_V7 select ARM_ARCH_TIMER select GENERIC_CLOCKEVENTS - select GENERIC_GETTIMEOFDAY + select GENERIC_GETTIMEOFDAY if HAVE_GENERIC_VDSO help This option enables support for the ARM architected timer diff --git a/arch/arm/kernel/vdso.c b/arch/arm/kernel/vdso.c index 6c69a5548ba2..a1c71f955579 100644 --- a/arch/arm/kernel/vdso.c +++ b/arch/arm/kernel/vdso.c @@ -276,15 +276,25 @@ static void vdso_write_end(struct vdso_data *vdata) ++vdso_data->seq_count; } +#ifdef CONFIG_GENERIC_GETTIMEOFDAY +static bool tk_clock_mode_is_archtimer(const struct timekeeper *tk) +{ + return + (tk->tkr_mono.clock->archdata.clock_mode == VDSO_CLOCKMODE_ARCHTIMER); +} +#else +static bool tk_clock_mode_is_archtimer(const struct timekeeper *tk) +{ + return true; +} +#endif + static bool tk_is_cntvct(const struct timekeeper *tk) { if (!IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) return false; - if (tk->tkr_mono.clock->archdata.clock_mode != VDSO_CLOCKMODE_ARCHTIMER) - return false; - - return true; + return tk_clock_mode_is_archtimer(tk); } /** diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 41d692a768e7..836e663244ec 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -71,7 +71,12 @@ static enum arch_timer_ppi_nr arch_timer_uses_ppi = ARCH_TIMER_VIRT_PPI; static bool arch_timer_c3stop; static bool arch_timer_mem_use_virtual; static bool arch_counter_suspend_stop; + +#ifdef CONFIG_GENERIC_GETTIMEOFDAY static enum vdso_clock_mode vdso_default = VDSO_CLOCKMODE_ARCHTIMER; +#else +static enum vdso_clock_mode vdso_default = VDSO_CLOCKMODE_NONE; +#endif static cpumask_t evtstrm_available = CPU_MASK_NONE; static bool evtstrm_enable = IS_ENABLED(CONFIG_ARM_ARCH_TIMER_EVTSTREAM);