summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-05-18 22:17:59 +0200
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 14:08:06 +0200
commit74dc51a3de06aa516e3b9fdc4017b2aeb38bf44b (patch)
tree85754dadbcbbf5d08dc39907abcf482a0b154324 /arch/x86
parentx86: distangle user disabled TSC from unstable (diff)
downloadlinux-74dc51a3de06aa516e3b9fdc4017b2aeb38bf44b.tar.xz
linux-74dc51a3de06aa516e3b9fdc4017b2aeb38bf44b.zip
x86: disable TSC for sched_clock() when calibration failed
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
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/tsc_32.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kernel/tsc_32.c b/arch/x86/kernel/tsc_32.c
index b087d691f165..068759db63dd 100644
--- a/arch/x86/kernel/tsc_32.c
+++ b/arch/x86/kernel/tsc_32.c
@@ -413,6 +413,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;
}