diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2008-05-24 17:40:18 +0000 |
---|---|---|
committer | Chris Wright <chrisw@sous-sol.org> | 2008-06-09 11:27:02 -0700 |
commit | 611a6f01f6cf797604dea042a0b64a868fd3170b (patch) | |
tree | 33bb5f77f8b6c8cb8121e0ce644685017d0cff1c /arch/x86 | |
parent | fdeb373e553c6feedfba6ffd005f837b5fef3622 (diff) |
x86: fix setup of cyc2ns in tsc_64.c
upstream commit: b6db80ee1331e7beaeb91b4b3d946dd16c72e388
When the TSC is calibrated against the PIT due to the nonavailability
of PMTIMER/HPET or due to SMI interference then the setup of the per
CPU cyc2ns variables is skipped. This is unlikely to happen but it
would definitely render sched_clock() unusable.
This was introduced with commit 53d517cdbaac704352b3d0c10fecb99e0b54572e
x86: scale cyc_2_nsec according to CPU frequency
Update the per CPU cyc2ns variables in all exit pathes of tsc_calibrate.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@kernel.org
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/tsc_64.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kernel/tsc_64.c b/arch/x86/kernel/tsc_64.c index d3bebaaad84..5153afca671 100644 --- a/arch/x86/kernel/tsc_64.c +++ b/arch/x86/kernel/tsc_64.c @@ -227,14 +227,14 @@ void __init tsc_calibrate(void) /* hpet or pmtimer available ? */ if (!hpet && !pm1 && !pm2) { printk(KERN_INFO "TSC calibrated against PIT\n"); - return; + goto out; } /* Check, whether the sampling was disturbed by an SMI */ if (tsc1 == ULONG_MAX || tsc2 == ULONG_MAX) { printk(KERN_WARNING "TSC calibration disturbed by SMI, " "using PIT calibration result\n"); - return; + goto out; } tsc2 = (tsc2 - tsc1) * 1000000L; @@ -255,6 +255,7 @@ void __init tsc_calibrate(void) tsc_khz = tsc2 / tsc1; +out: for_each_possible_cpu(cpu) set_cyc2ns_scale(tsc_khz, cpu); } |