]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/x86/kernel/tsc.c
Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / arch / x86 / kernel / tsc.c
index 37e7cf544e51580e8633651bed25858cbcb840bf..2724dc82f992ef2845fddc55c5965c9a00aa0113 100644 (file)
@@ -1107,6 +1107,16 @@ static u64 read_tsc(struct clocksource *cs)
        return (u64)rdtsc_ordered();
 }
 
+static void tsc_cs_mark_unstable(struct clocksource *cs)
+{
+       if (tsc_unstable)
+               return;
+       tsc_unstable = 1;
+       clear_sched_clock_stable();
+       disable_sched_clock_irqtime();
+       pr_info("Marking TSC unstable due to clocksource watchdog\n");
+}
+
 /*
  * .mask MUST be CLOCKSOURCE_MASK(64). See comment above read_tsc()
  */
@@ -1119,6 +1129,7 @@ static struct clocksource clocksource_tsc = {
                                  CLOCK_SOURCE_MUST_VERIFY,
        .archdata               = { .vclock_mode = VCLOCK_TSC },
        .resume                 = tsc_resume,
+       .mark_unstable          = tsc_cs_mark_unstable,
 };
 
 void mark_tsc_unstable(char *reason)