Skip to content

Commit

Permalink
x86: disable TSC for sched_clock() when calibration failed
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Thomas Gleixner committed May 23, 2008
1 parent 9ccc906 commit 74dc51a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/x86/kernel/tsc_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 74dc51a

Please sign in to comment.