summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/i8259.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2017-12-22 12:20:11 +0300
committerThomas Gleixner <tglx@linutronix.de>2018-01-14 22:18:23 +0300
commit30c7e5b123673d5e570e238dbada2fb68a87212c (patch)
tree2b1ccd53e66e21b0f5f8a6f0afc3a3bf19975513 /arch/x86/include/asm/i8259.h
parent4b5b2127238e689ee18aa6752959751dd61c4c73 (diff)
downloadlinux-30c7e5b123673d5e570e238dbada2fb68a87212c.tar.xz
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
Diffstat (limited to 'arch/x86/include/asm/i8259.h')
-rw-r--r--arch/x86/include/asm/i8259.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/include/asm/i8259.h b/arch/x86/include/asm/i8259.h
index c8376b40e882..5cdcdbd4d892 100644
--- a/arch/x86/include/asm/i8259.h
+++ b/arch/x86/include/asm/i8259.h
@@ -69,6 +69,11 @@ struct legacy_pic {
extern struct legacy_pic *legacy_pic;
extern struct legacy_pic null_legacy_pic;
+static inline bool has_legacy_pic(void)
+{
+ return legacy_pic != &null_legacy_pic;
+}
+
static inline int nr_legacy_irqs(void)
{
return legacy_pic->nr_legacy_irqs;