Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit a60dd06

Browse files
David StevensKAGA-KOKO
authored andcommitted
genirq/cpuhotplug: Skip suspended interrupts when restoring affinity
irq_restore_affinity_of_irq() restarts managed interrupts unconditionally when the first CPU in the affinity mask comes online. That's correct during normal hotplug operations, but not when resuming from S3 because the drivers are not resumed yet and interrupt delivery is not expected by them. Skip the startup of suspended interrupts and let resume_device_irqs() deal with restoring them. This ensures that irqs are not delivered to drivers during the noirq phase of resuming from S3, after non-boot CPUs are brought back online. Signed-off-by: David Stevens <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7da4ba3 commit a60dd06

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

kernel/irq/cpuhotplug.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,15 @@ static void irq_restore_affinity_of_irq(struct irq_desc *desc, unsigned int cpu)
195195
!irq_data_get_irq_chip(data) || !cpumask_test_cpu(cpu, affinity))
196196
return;
197197

198-
if (irqd_is_managed_and_shutdown(data)) {
199-
irq_startup(desc, IRQ_RESEND, IRQ_START_COND);
198+
/*
199+
* Don't restore suspended interrupts here when a system comes back
200+
* from S3. They are reenabled via resume_device_irqs().
201+
*/
202+
if (desc->istate & IRQS_SUSPENDED)
200203
return;
201-
}
204+
205+
if (irqd_is_managed_and_shutdown(data))
206+
irq_startup(desc, IRQ_RESEND, IRQ_START_COND);
202207

203208
/*
204209
* If the interrupt can only be directed to a single target

kernel/irq/manage.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -800,10 +800,14 @@ void __enable_irq(struct irq_desc *desc)
800800
irq_settings_set_noprobe(desc);
801801
/*
802802
* Call irq_startup() not irq_enable() here because the
803-
* interrupt might be marked NOAUTOEN. So irq_startup()
804-
* needs to be invoked when it gets enabled the first
805-
* time. If it was already started up, then irq_startup()
806-
* will invoke irq_enable() under the hood.
803+
* interrupt might be marked NOAUTOEN so irq_startup()
804+
* needs to be invoked when it gets enabled the first time.
805+
* This is also required when __enable_irq() is invoked for
806+
* a managed and shutdown interrupt from the S3 resume
807+
* path.
808+
*
809+
* If it was already started up, then irq_startup() will
810+
* invoke irq_enable() under the hood.
807811
*/
808812
irq_startup(desc, IRQ_RESEND, IRQ_START_FORCE);
809813
break;

0 commit comments

Comments
 (0)