[tip: timers/vdso] MIPS: csrc-r4k: Only use VDSO_CLOCKMODE_R4K when it is a available
From: tip-bot2 for Thomas Weißschuh
Date: Tue Jun 09 2026 - 11:14:19 EST
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: f3dc8fb24f90fa2901a87fb5273edabcc4e8f2ed
Gitweb: https://git.kernel.org/tip/f3dc8fb24f90fa2901a87fb5273edabcc4e8f2ed
Author: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
AuthorDate: Thu, 21 May 2026 08:53:19 +02:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
CommitterDate: Tue, 09 Jun 2026 17:02:10 +02:00
MIPS: csrc-r4k: Only use VDSO_CLOCKMODE_R4K when it is a available
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@xxxxxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Cc: Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>
Link: https://patch.msgid.link/20260521-vdso-mips-kconfig-v1-5-2f79dcd6c78f@xxxxxxxxxxxxx
---
arch/mips/kernel/csrc-r4k.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/mips/kernel/csrc-r4k.c b/arch/mips/kernel/csrc-r4k.c
index 59eca39..241a934 100644
--- a/arch/mips/kernel/csrc-r4k.c
+++ b/arch/mips/kernel/csrc-r4k.c
@@ -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);