]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
MIPS: csrc-r4k: Only use VDSO_CLOCKMODE_R4K when it is a available
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Thu, 21 May 2026 06:53:19 +0000 (08:53 +0200)
committerThomas Gleixner <tglx@kernel.org>
Tue, 9 Jun 2026 15:02:10 +0000 (17:02 +0200)
VDSO_CLOCKMODE_R4K is only defined if CONFIG_GENERIC_GETTIMEOFDAY is
enabled. Right now this is always the case, but it will change soon.

Prepare for the potential unavailability of VDSO_CLOCKMODE_R4K.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Link: https://patch.msgid.link/20260521-vdso-mips-kconfig-v1-5-2f79dcd6c78f@linutronix.de
arch/mips/kernel/csrc-r4k.c

index 59eca397f2971c1e598f6fdf98125041e0215524..241a934543a8f81ae877d1c80c3d7fc3c0435788 100644 (file)
@@ -126,12 +126,14 @@ int __init init_r4k_clocksource(void)
        clocksource_mips.rating = 200;
        clocksource_mips.rating += clamp(mips_hpt_frequency / 10000000, 0, 99);
 
+#ifdef CONFIG_GENERIC_GETTIMEOFDAY
        /*
         * R2 onwards makes the count accessible to user mode so it can be used
         * by the VDSO (HWREna is configured by configure_hwrena()).
         */
        if (cpu_has_mips_r2_r6 && rdhwr_count_usable())
                clocksource_mips.vdso_clock_mode = VDSO_CLOCKMODE_R4K;
+#endif
 
        clocksource_register_hz(&clocksource_mips, mips_hpt_frequency);