Skip to content

Commit 0c0e37d

Browse files
committed
x86/ioapic: Force affinity setup before startup
The IO/APIC cannot handle interrupt affinity changes safely after startup other than from an interrupt handler. The startup sequence in the generic interrupt code violates that assumption. Mark the irq chip with the new IRQCHIP_AFFINITY_PRE_STARTUP flag so that the default interrupt setting happens before the interrupt is started up for the first time. Fixes: 1840475 ("genirq: Expose default irq affinity mask (take 3)") Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Marc Zyngier <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent 826da77 commit 0c0e37d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/x86/kernel/apic/io_apic.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,8 @@ static struct irq_chip ioapic_chip __read_mostly = {
19861986
.irq_set_affinity = ioapic_set_affinity,
19871987
.irq_retrigger = irq_chip_retrigger_hierarchy,
19881988
.irq_get_irqchip_state = ioapic_irq_get_chip_state,
1989-
.flags = IRQCHIP_SKIP_SET_WAKE,
1989+
.flags = IRQCHIP_SKIP_SET_WAKE |
1990+
IRQCHIP_AFFINITY_PRE_STARTUP,
19901991
};
19911992

19921993
static struct irq_chip ioapic_ir_chip __read_mostly = {
@@ -1999,7 +2000,8 @@ static struct irq_chip ioapic_ir_chip __read_mostly = {
19992000
.irq_set_affinity = ioapic_set_affinity,
20002001
.irq_retrigger = irq_chip_retrigger_hierarchy,
20012002
.irq_get_irqchip_state = ioapic_irq_get_chip_state,
2002-
.flags = IRQCHIP_SKIP_SET_WAKE,
2003+
.flags = IRQCHIP_SKIP_SET_WAKE |
2004+
IRQCHIP_AFFINITY_PRE_STARTUP,
20032005
};
20042006

20052007
static inline void init_IO_APIC_traps(void)

0 commit comments

Comments
 (0)