[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250612183303.3433234-3-briannorris@chromium.org>
Date: Thu, 12 Jun 2025 11:32:52 -0700
From: Brian Norris <briannorris@...omium.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Douglas Anderson <dianders@...omium.org>,
David Stevens <stevensd@...omium.org>,
linux-kernel@...r.kernel.org,
Tsai Sung-Fu <danielsftsai@...gle.com>,
Aleksandrs Vinarskis <alex.vinarskis@...il.com>,
Johan Hovold <johan@...nel.org>,
Brian Norris <briannorris@...omium.org>
Subject: [PATCH 6.16 2/2] genirq/cpuhotplug: Restore affinity even for suspended IRQ
Commit 788019eb559f ("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 had an intentional imbalance -- that they skip
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), we would skip calling
irq_startup_managed() when resuming, 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 a60dd06af674
("genirq/cpuhotplug: Skip suspended interrupts when restoring affinity")
for essentially the same reason as commit 788019eb559f -- that
irq_startup() would unconditionally re-enable an interrupt too early.
Because irq_startup_managed() now respsects the disable-depth count, we
no longer need the IRQS_SUSPENDED check, and instead, it causes harm.
Thus, drop the IRQS_SUSPENDED check, and restore balance.
This effectively reverts commit a60dd06af674 ("genirq/cpuhotplug: Skip
suspended interrupts when restoring affinity"), because it is replaced
by commit 788019eb559f ("genirq: Retain disable depth for managed
interrupts across CPU hotplug").
Fixes: 788019eb559f ("genirq: Retain disable depth for managed interrupts across CPU hotplug")
Reported-by: Aleksandrs Vinarskis <alex.vinarskis@...il.com>
Closes: https://lore.kernel.org/lkml/24ec4adc-7c80-49e9-93ee-19908a97ab84@gmail.com/
Signed-off-by: Brian Norris <briannorris@...omium.org>
---
kernel/irq/cpuhotplug.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c
index f07529ae4895..755346ea9819 100644
--- a/kernel/irq/cpuhotplug.c
+++ b/kernel/irq/cpuhotplug.c
@@ -210,13 +210,6 @@ static void irq_restore_affinity_of_irq(struct irq_desc *desc, unsigned int cpu)
!irq_data_get_irq_chip(data) || !cpumask_test_cpu(cpu, affinity))
return;
- /*
- * Don't restore suspended interrupts here when a system comes back
- * from S3. They are reenabled via resume_device_irqs().
- */
- if (desc->istate & IRQS_SUSPENDED)
- return;
-
if (irqd_is_managed_and_shutdown(data))
irq_startup_managed(desc);
--
2.50.0.rc1.591.g9c95f17f64-goog
Powered by blists - more mailing lists