Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74dc51a3 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

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: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: stable@kernel.org
parent 9ccc906c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;
	}