]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
MIPS: csrc-r4k: Apply verification clocksource flags
authorJiaxun Yang <jiaxun.yang@flygoat.com>
Wed, 12 Jun 2024 08:54:29 +0000 (09:54 +0100)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Wed, 3 Jul 2024 14:45:25 +0000 (16:45 +0200)
CP0 counter suffers from various problems like SMP sync,
behaviour on wait.

Set CLOCK_SOURCE_MUST_VERIFY and CLOCK_SOURCE_VERIFY_PERCPU,
as what x86 did to TSC, to let kernel test it before use.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/kernel/csrc-r4k.c

index f02ae333f4f958e697aec059564529f93d9d35f0..055747a7417d6b515bbb231087a44622e7c5be83 100644 (file)
@@ -21,7 +21,9 @@ static struct clocksource clocksource_mips = {
        .name           = "MIPS",
        .read           = c0_hpt_read,
        .mask           = CLOCKSOURCE_MASK(32),
-       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
+       .flags          = CLOCK_SOURCE_IS_CONTINUOUS |
+                                 CLOCK_SOURCE_MUST_VERIFY |
+                                 CLOCK_SOURCE_VERIFY_PERCPU,
 };
 
 static u64 __maybe_unused notrace r4k_read_sched_clock(void)