x86/tsc: Allow TSC calibration without PIT
authorPeter Zijlstra <peterz@infradead.org>
Fri, 22 Dec 2017 09:20:11 +0000 (10:20 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 14 Jan 2018 19:18:23 +0000 (20:18 +0100)
commit30c7e5b123673d5e570e238dbada2fb68a87212c
tree2b1ccd53e66e21b0f5f8a6f0afc3a3bf19975513
parent4b5b2127238e689ee18aa6752959751dd61c4c73
x86/tsc: Allow TSC calibration without PIT

Zhang Rui reported that a Surface Pro 4 will fail to boot with
lapic=notscdeadline. Part of the problem is that that machine doesn't have
a PIT.

If, for some reason, the TSC init has to fall back to TSC calibration, it
relies on the PIT to be present.

Allow TSC calibration to reliably fall back to HPET.

The below results in an accurate TSC measurement when forced on a IVB:

  tsc: Unable to calibrate against PIT
  tsc: No reference (HPET/PMTIMER) available
  tsc: Unable to calibrate against PIT
  tsc: using HPET reference calibration
  tsc: Detected 2792.451 MHz processor

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: len.brown@intel.com
Cc: rui.zhang@intel.com
Link: https://lkml.kernel.org/r/20171222092243.333145937@infradead.org
arch/x86/include/asm/i8259.h
arch/x86/kernel/tsc.c