diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2020-01-23 12:54:53 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2020-01-29 12:50:12 +0100 |
commit | 979923871f69a4dc926658f9f9a1a4c1bde57552 (patch) | |
tree | e9067d24ec18e59a887eada03aead116d17935a8 /arch/x86/kernel/x86_init.c | |
parent | 6bd3357b6181bd38c1a757168a8842e09ec6f3fb (diff) | |
download | lwn-979923871f69a4dc926658f9f9a1a4c1bde57552.tar.gz lwn-979923871f69a4dc926658f9f9a1a4c1bde57552.zip |
x86/timer: Don't skip PIT setup when APIC is disabled or in legacy mode
Tony reported a boot regression caused by the recent workaround for systems
which have a disabled (clock gate off) PIT.
On his machine the kernel fails to initialize the PIT because
apic_needs_pit() does not take into account whether the local APIC
interrupt delivery mode will actually allow to setup and use the local
APIC timer. This should be easy to reproduce with acpi=off on the
command line which also disables HPET.
Due to the way the PIT/HPET and APIC setup ordering works (APIC setup can
require working PIT/HPET) the information is not available at the point
where apic_needs_pit() makes this decision.
To address this, split out the interrupt mode selection from
apic_intr_mode_init(), invoke the selection before making the decision
whether PIT is required or not, and add the missing checks into
apic_needs_pit().
Fixes: c8c4076723da ("x86/timer: Skip PIT initialization on modern chipsets")
Reported-by: Anthony Buckley <tony.buckley000@gmail.com>
Tested-by: Anthony Buckley <tony.buckley000@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Daniel Drake <drake@endlessm.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=206125
Link: https://lore.kernel.org/r/87sgk6tmk2.fsf@nanos.tec.linutronix.de
Diffstat (limited to 'arch/x86/kernel/x86_init.c')
-rw-r--r-- | arch/x86/kernel/x86_init.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index ce89430a7f80..9a89261dcd2a 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -80,6 +80,7 @@ struct x86_init_ops x86_init __initdata = { .pre_vector_init = init_ISA_irqs, .intr_init = native_init_IRQ, .trap_init = x86_init_noop, + .intr_mode_select = apic_intr_mode_select, .intr_mode_init = apic_intr_mode_init }, |