linux_dsm_epyc7002/arch/x86/kernel/apic
Vitaly Kuznetsov 8c058b0b9c x86/irq: Probe for PIC presence before allocating descs for legacy IRQs
Commit d32932d02e ("x86/irq: Convert IOAPIC to use hierarchical irqdomain
interfaces") brought a regression for Hyper-V Gen2 instances. These
instances don't have i8259 legacy PIC but they use legacy IRQs for serial
port, rtc, and acpi. With this commit included we end up with these IRQs
not initialized. Earlier, there was a special workaround for legacy IRQs
in mp_map_pin_to_irq() doing mp_irqdomain_map() without looking at
nr_legacy_irqs() and now we fail in __irq_domain_alloc_irqs() when
irq_domain_alloc_descs() returns -EEXIST.

The essence of the issue seems to be that early_irq_init() calls
arch_probe_nr_irqs() to figure out the number of legacy IRQs before
we probe for i8259 and gets 16. Later when init_8259A() is called we switch
to NULL legacy PIC and nr_legacy_irqs() starts to return 0 but we already
have 16 descs allocated.

Solve the issue by separating i8259 probe from init and calling it in
arch_probe_nr_irqs() before we actually use nr_legacy_irqs() information.

Fixes: d32932d02e ("x86/irq: Convert IOAPIC to use hierarchical irqdomain interfaces")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: Jiang Liu <jiang.liu@linux.intel.com>
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1446543614-3621-1-git-send-email-vkuznets@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2015-11-07 10:37:37 +01:00
..
apic_flat_64.c x86/smpboot: Remove APIC.wait_for_init_deassert and atomic init_deasserted 2015-08-17 10:42:28 +02:00
apic_noop.c x86/smpboot: Remove APIC.wait_for_init_deassert and atomic init_deasserted 2015-08-17 10:42:28 +02:00
apic_numachip.c x86/numachip: Add Numachip IPI optimisations 2015-09-22 22:25:33 +02:00
apic.c x86/apic: Deinline various functions 2015-09-30 21:15:53 +02:00
bigsmp_32.c x86/smpboot: Remove APIC.wait_for_init_deassert and atomic init_deasserted 2015-08-17 10:42:28 +02:00
htirq.c x86: Constify irqdomain ops 2015-05-05 11:14:48 +02:00
hw_nmi.c nmi: x86: convert to generic nmi handler 2015-07-17 12:23:30 +01:00
io_apic.c Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-11-03 18:33:15 -08:00
ipi.c x86: Delete non-required instances of include <linux/init.h> 2014-01-06 21:25:18 -08:00
Makefile x86, irq: Move HT IRQ related code from io_apic.c into htirq.c 2014-12-16 14:08:17 +01:00
msi.c x86/irq: Use accessor irq_data_get_irq_handler_data() 2015-07-13 21:22:46 +02:00
probe_32.c x86/smpboot: Remove APIC.wait_for_init_deassert and atomic init_deasserted 2015-08-17 10:42:28 +02:00
probe_64.c
vector.c x86/irq: Probe for PIC presence before allocating descs for legacy IRQs 2015-11-07 10:37:37 +01:00
x2apic_cluster.c Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-09-01 09:33:26 -07:00
x2apic_phys.c x86/smpboot: Remove APIC.wait_for_init_deassert and atomic init_deasserted 2015-08-17 10:42:28 +02:00
x2apic_uv_x.c x86/smpboot: Remove APIC.wait_for_init_deassert and atomic init_deasserted 2015-08-17 10:42:28 +02:00