Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/ioapic: Correct the PCI/ISA trigger type selection

PCI's default trigger type is level and ISA's is edge. The recent
refactoring made it the other way round, which went unnoticed as it seems
only to cause havoc on some AMD systems.

Make the comment and code do the right thing again.

Fixes: a27dca645d2c ("x86/io_apic: Cleanup trigger/polarity helpers")
Reported-by: Tom Lendacky <thomas.lendacky@amd.com>
Reported-by: Borislav Petkov <bp@alien8.de>
Reported-by: Qian Cai <cai@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
Cc: David Woodhouse <dwmw@amazon.co.uk>
Link: https://lore.kernel.org/r/87d00lgu13.fsf@nanos.tec.linutronix.de

+2 -2
+2 -2
arch/x86/kernel/apic/io_apic.c
··· 809 809 case MP_IRQTRIG_DEFAULT: 810 810 /* 811 811 * Conforms to spec, ie. bus-type dependent trigger 812 - * mode. PCI defaults to egde, ISA to level. 812 + * mode. PCI defaults to level, ISA to edge. 813 813 */ 814 - level = test_bit(bus, mp_bus_not_pci); 814 + level = !test_bit(bus, mp_bus_not_pci); 815 815 /* Take EISA into account */ 816 816 return eisa_irq_is_level(idx, bus, level); 817 817 case MP_IRQTRIG_EDGE: