Skip to content

Commit

Permalink
x86: tsc: Prevent delayed init if initial tsc calibration failed
Browse files Browse the repository at this point in the history
commit a8760ec (x86: Check tsc available/disabled in the delayed init
function) missed to prevent the setup of the delayed init function in
case the initial tsc calibration failed. This results in the same
divide by zero bug as we have seen without the tsc disabled check.

Skip the delayed work setup when tsc_khz (the initial calibration
value) is 0.

Bisected-and-tested-by: Kirill A. Shutemov <kas@openvz.org>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Thomas Gleixner committed Jan 11, 2011
1 parent 4aed89d commit 29fe359
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kernel/tsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ static void tsc_refine_calibration_work(struct work_struct *work)

static int __init init_tsc_clocksource(void)
{
if (!cpu_has_tsc || tsc_disabled > 0)
if (!cpu_has_tsc || tsc_disabled > 0 || !tsc_khz)
return 0;

if (tsc_clocksource_reliable)
Expand Down

0 comments on commit 29fe359

Please sign in to comment.