Skip to contentSkip to conversation

x86: tsc: Prevent delayed init if initial tsc calibration failed

tip:x86/urgent John Stultz 1 participant 1 message Jan 11, 2011 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

John Stultz

author Acked-by
#1 lore raw
Quoted 14 lines · tip-bot for Thomas Gleixner
Commit-ID:  29fe359ca20326e57b25e8545c49ed9ff5e830c7
Gitweb:     http://git.kernel.org/tip/29fe359ca20326e57b25e8545c49ed9ff5e830c7
Author:     Thomas Gleixner <[email protected]>
AuthorDate: Tue, 11 Jan 2011 11:40:48 +0100
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Tue, 11 Jan 2011 11:48:39 +0100

x86: tsc: Prevent delayed init if initial tsc calibration failed

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.

Quoted 6 lines

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

Krill: Thanks for reporting and testing!

Thomas: Thanks for the fix. I'll see if we can't condense the invalid states a bit more. If tsc_khz=0, we probably should set tsc_disabled.

Quoted 17 lines
---
 arch/x86/kernel/tsc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/tsc.c +1 -1
index 356a0d4..463901e 100644
@@ -965,7 +965,7 @@ out:
 
 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)