]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
x86: disable TSC for sched_clock() when calibration failed
authorThomas Gleixner <tglx@linutronix.de>
Sat, 24 May 2008 17:40:17 +0000 (17:40 +0000)
committerChris Wright <chrisw@sous-sol.org>
Mon, 9 Jun 2008 18:27:02 +0000 (11:27 -0700)
upstream commit: 74dc51a3de06aa516e3b9fdc4017b2aeb38bf44b

When the TSC calibration fails then TSC is still used in
sched_clock(). Disable it completely in that case.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@kernel.org
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
arch/x86/kernel/tsc_32.c

index 021723ccd50750d8788bb085e683fdc472394679..01e4f8b2624c5b840d87c78c7ed02f45eb155681 100644 (file)
@@ -401,6 +401,11 @@ void __init tsc_init(void)
 
        if (!cpu_khz) {
                mark_tsc_unstable("could not calculate TSC khz");
+               /*
+                * We need to disable the TSC completely in this case
+                * to prevent sched_clock() from using it.
+                */
+               tsc_disabled = 1;
                return;
        }