Skip to content

Commit 4857c91

Browse files
committed
x86/ioapic: Force affinity setting in setup_ioapic_dest()
The recent ioapic cleanups changed the affinity setting in setup_ioapic_dest() from a direct write to the hardware to the delayed affinity setup via irq_set_affinity(). That results in a warning from chained_irq_exit(): WARNING: CPU: 0 PID: 5 at kernel/irq/migration.c:32 irq_move_masked_irq [<ffffffff810a0a88>] irq_move_masked_irq+0xb8/0xc0 [<ffffffff8103c161>] ioapic_ack_level+0x111/0x130 [<ffffffff812bbfe8>] intel_gpio_irq_handler+0x148/0x1c0 The reason is that irq_set_affinity() does not write directly to the hardware. It marks the affinity setting as pending and executes it from the next interrupt. The chained handler infrastructure does not take the irq descriptor lock for performance reasons because such a chained interrupt is not visible to any interfaces. So the delayed affinity setting triggers the warning in irq_move_masked_irq(). Restore the old behaviour by calling the set_affinity function of the ioapic chip in setup_ioapic_dest(). This is safe as none of the interrupts can be on the fly at this point. Fixes: aa5cb97 'x86/irq: Remove x86_io_apic_ops.set_affinity and related interfaces' Reported-and-tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Jiang Liu <jiang.liu@linux.intel.com> Cc: jarkko.nikula@linux.intel.com
1 parent cda34fc commit 4857c91

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/x86/kernel/apic/io_apic.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,6 +2522,7 @@ void __init setup_ioapic_dest(void)
25222522
int pin, ioapic, irq, irq_entry;
25232523
const struct cpumask *mask;
25242524
struct irq_data *idata;
2525+
struct irq_chip *chip;
25252526

25262527
if (skip_ioapic_setup == 1)
25272528
return;
@@ -2545,9 +2546,9 @@ void __init setup_ioapic_dest(void)
25452546
else
25462547
mask = apic->target_cpus();
25472548

2548-
irq_set_affinity(irq, mask);
2549+
chip = irq_data_get_irq_chip(idata);
2550+
chip->irq_set_affinity(idata, mask, false);
25492551
}
2550-
25512552
}
25522553
#endif
25532554

0 commit comments

Comments
 (0)