[tip: timers/vdso] clocksource/drivers/mips-gic-timer: Only use VDSO_CLOCKMODE_GIC when it is a available

From: tip-bot2 for Thomas Weißschuh

Date: Thu Jun 04 2026 - 12:40:53 EST


The following commit has been merged into the timers/vdso branch of tip:

Commit-ID: a7d9141d5ddf08fa3cd50a079be4bd93a8aa42fe
Gitweb: https://git.kernel.org/tip/a7d9141d5ddf08fa3cd50a079be4bd93a8aa42fe
Author: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
AuthorDate: Thu, 21 May 2026 08:53:20 +02:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
CommitterDate: Thu, 04 Jun 2026 18:22:46 +02:00

clocksource/drivers/mips-gic-timer: Only use VDSO_CLOCKMODE_GIC when it is a available

VDSO_CLOCKMODE_GIC 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_GIC.

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-6-2f79dcd6c78f@xxxxxxxxxxxxx
---
drivers/clocksource/mips-gic-timer.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/clocksource/mips-gic-timer.c b/drivers/clocksource/mips-gic-timer.c
index 1501c7d..a166926 100644
--- a/drivers/clocksource/mips-gic-timer.c
+++ b/drivers/clocksource/mips-gic-timer.c
@@ -198,7 +198,9 @@ static struct clocksource gic_clocksource = {
.name = "GIC",
.read = gic_hpt_read,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
+#ifdef CONFIG_GENERIC_GETTIMEOFDAY
.vdso_clock_mode = VDSO_CLOCKMODE_GIC,
+#endif
};

static void gic_clocksource_unstable(char *reason)