From: Andrew Morton This makes an unholy mess of time-x86_64-split-x86_64-kernel-timec-up.patch Cc: Andi Kleen Cc: John Stultz Cc: Ingo Molnar Cc: Thomas Gleixner Signed-off-by: Andrew Morton --- arch/x86_64/kernel/time.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff -puN arch/x86_64/kernel/time.c~revert-x86_64-mm-ignore-long-smi-interrupts-in-clock-calibration arch/x86_64/kernel/time.c --- a/arch/x86_64/kernel/time.c~revert-x86_64-mm-ignore-long-smi-interrupts-in-clock-calibration +++ a/arch/x86_64/kernel/time.c @@ -658,25 +658,6 @@ core_initcall(cpufreq_tsc); */ #define TICK_COUNT 100000000 -#define TICK_MIN 5000 - -/* - * Some platforms take periodic SMI interrupts with 5ms duration. Make sure none - * occurs between the reads of the hpet & TSC. - */ -static void __init read_hpet_tsc(int *hpet, int *tsc) -{ - int tsc1, tsc2, hpet1; - - do { - tsc1 = get_cycles_sync(); - hpet1 = hpet_readl(HPET_COUNTER); - tsc2 = get_cycles_sync(); - } while (tsc2 - tsc1 > TICK_MIN); - *hpet = hpet1; - *tsc = tsc2; -} - static unsigned int __init hpet_calibrate_tsc(void) { @@ -687,11 +668,13 @@ static unsigned int __init hpet_calibrat local_irq_save(flags); local_irq_disable(); - read_hpet_tsc(&hpet_start, &tsc_start); + hpet_start = hpet_readl(HPET_COUNTER); + rdtscl(tsc_start); do { local_irq_disable(); - read_hpet_tsc(&hpet_now, &tsc_now); + hpet_now = hpet_readl(HPET_COUNTER); + tsc_now = get_cycles_sync(); local_irq_restore(flags); } while ((tsc_now - tsc_start) < TICK_COUNT && (hpet_now - hpet_start) < TICK_COUNT); _