Skip to content

Commit 72218d7

Browse files
computersforpeaceKAGA-KOKO
authored andcommitted
genirq/cpuhotplug: Restore affinity even for suspended IRQ
Commit 788019e ("genirq: Retain disable depth for managed interrupts across CPU hotplug") tried to make managed shutdown/startup properly reference counted, but it missed the fact that the unplug and hotplug code has an intentional imbalance by skipping IRQS_SUSPENDED interrupts on the "restore" path. This means that if a managed-affinity interrupt was both suspended and managed-shutdown (such as may happen during system suspend / S3), resume skips calling irq_startup_managed(), and would again have an unbalanced depth this time, with a positive value (i.e., remaining unexpectedly masked). This IRQS_SUSPENDED check was introduced in commit a60dd06 ("genirq/cpuhotplug: Skip suspended interrupts when restoring affinity") for essentially the same reason as commit 788019e, to prevent that irq_startup() would unconditionally re-enable an interrupt too early. Because irq_startup_managed() now respsects the disable-depth count, the IRQS_SUSPENDED check is not longer needed, and instead, it causes harm. Thus, drop the IRQS_SUSPENDED check, and restore balance. This effectively reverts commit a60dd06 ("genirq/cpuhotplug: Skip suspended interrupts when restoring affinity"), because it is replaced by commit 788019e ("genirq: Retain disable depth for managed interrupts across CPU hotplug"). Fixes: 788019e ("genirq: Retain disable depth for managed interrupts across CPU hotplug") Reported-by: Aleksandrs Vinarskis <[email protected]> Signed-off-by: Brian Norris <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Aleksandrs Vinarskis <[email protected]> Link: https://lore.kernel.org/all/[email protected] Closes: https://lore.kernel.org/lkml/[email protected]/
1 parent 2b32fc8 commit 72218d7

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

kernel/irq/cpuhotplug.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,6 @@ static void irq_restore_affinity_of_irq(struct irq_desc *desc, unsigned int cpu)
210210
!irq_data_get_irq_chip(data) || !cpumask_test_cpu(cpu, affinity))
211211
return;
212212

213-
/*
214-
* Don't restore suspended interrupts here when a system comes back
215-
* from S3. They are reenabled via resume_device_irqs().
216-
*/
217-
if (desc->istate & IRQS_SUSPENDED)
218-
return;
219-
220213
if (irqd_is_managed_and_shutdown(data))
221214
irq_startup_managed(desc);
222215

0 commit comments

Comments
 (0)