mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
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
This commit is contained in:
parent
9ccc906c97
commit
74dc51a3de
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue