]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
x86: Check tsc available/disabled in the delayed init function
authorThomas Gleixner <tglx@linutronix.de>
Mon, 13 Dec 2010 10:28:02 +0000 (11:28 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 13 Dec 2010 10:35:05 +0000 (11:35 +0100)
The delayed TSC init function does not check whether the system has no
TSC or TSC is disabled at the kernel command line, which results in a
crash in the work queue based extended calibration due to division by
zero because the basic calibration never happened.

Add the missing checks and do not touch TSC when not available or
disabled.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <johnstul@us.ibm.com>
arch/x86/kernel/tsc.c

index dc1393e7cbfb2dfa231c2e5b922ee3dba1f39e1c..356a0d455cf997cb1bd586d3a13fd8a7c16d4d3c 100644 (file)
@@ -965,6 +965,9 @@ out:
 
 static int __init init_tsc_clocksource(void)
 {
+       if (!cpu_has_tsc || tsc_disabled > 0)
+               return 0;
+
        if (tsc_clocksource_reliable)
                clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY;
        /* lower the rating if we already know its unstable: */