From: Thomas Gleixner Date: Sun, 18 May 2008 20:17:59 +0000 (+0200) Subject: x86: disable TSC for sched_clock() when calibration failed X-Git-Tag: v2.6.26-rc4~11^2~5 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=74dc51a3de06aa516e3b9fdc4017b2aeb38bf44b;p=linux-2.6-omap-h63xx.git 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 Cc: stable@kernel.org --- diff --git a/arch/x86/kernel/tsc_32.c b/arch/x86/kernel/tsc_32.c index b087d691f16..068759db63d 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; }