Skip to content

Commit a8760ec

Browse files
committed
x86: Check tsc available/disabled in the delayed init function
The delayed TSC init function does not check whether the system has no TSC or TSC is disabled at the kernel command line, which results in a crash in the work queue based extended calibration due to division by zero because the basic calibration never happened. Add the missing checks and do not touch TSC when not available or disabled. Signed-off-by: Thomas Gleixner <[email protected]> Cc: John Stultz <[email protected]>
1 parent 08ec0c5 commit a8760ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/x86/kernel/tsc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,9 @@ static void tsc_refine_calibration_work(struct work_struct *work)
965965

966966
static int __init init_tsc_clocksource(void)
967967
{
968+
if (!cpu_has_tsc || tsc_disabled > 0)
969+
return 0;
970+
968971
if (tsc_clocksource_reliable)
969972
clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY;
970973
/* lower the rating if we already know its unstable: */

0 commit comments

Comments
 (0)