[PATCH 2/2] x86/ioapic: avoid timer manipulation when IRQ0 timer is unavailable

From: Daniel Drake
Date: Tue Apr 23 2019 - 01:05:38 EST


New products based on Intel Apollo Lake are appearing where the HPET is
not present in ACPI, and the legacy 8254 PIT is "gated" by default in
the BIOS setup menu.

This leads an early boot "IO-APIC + timer doesn't work!" kernel panic
on a black screen (before the framebuffer is initialized).

Avoid the IO-APIC IRQ0 timer manipulation & verification on platforms
where the legacy IRQ0 timer has been determined as unavailable.

This fixes boot on Connex L1430 and Scope SN116PYA with default BIOS
settings.

Signed-off-by: Daniel Drake <drake@xxxxxxxxxxxx>
Link: https://lkml.kernel.org/r/CAD8Lp45fedoPLnK=UmUhhtkjy5u2h04sYKrx3U+m04U6FpVZ4A@xxxxxxxxxxxxxx
---
arch/x86/kernel/apic/io_apic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index ae46da48c07b..2d29c62abbcb 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2243,7 +2243,7 @@ void __init setup_IO_APIC(void)
sync_Arb_IDs();
setup_IO_APIC_irqs();
init_IO_APIC_traps();
- if (nr_legacy_irqs())
+ if (global_clock_event && nr_legacy_irqs())
check_timer();

ioapic_initialized = 1;
--
2.19.1