Commit a7fd09ec authored by Brian Norris's avatar Brian Norris Committed by Giuliano Procida
Browse files

FROMGIT: genirq: Retain depth for managed IRQs across CPU hotplug



Affinity-managed IRQs may be shut down and restarted during CPU
hotunplug/plug, and the IRQ may be left in an unexpected state.
Specifically:

 1. IRQ affines to CPU N
 2. disable_irq() -> depth is 1
 3. CPU N goes offline
 4. irq_shutdown() -> depth is set to 1 (again)
 5. CPU N goes online
 6. irq_startup() -> depth is set to 0 (BUG! client expected IRQ is
    still disabled)
 7. enable_irq() -> depth underflow / unbalanced enable_irq() WARN

It seems depth only needs preserved for managed IRQs + CPU hotplug, so
per Thomas's recommendation, we make that explicit.

I add kunit tests that cover some of this in a following patch.

Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
Co-developed-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250514201353.3481400-2-briannorris@chromium.org
Bug: 417330473
Bug: 419054566
Change-Id: I9e19d182b0c16f353aa9068cac4eff8a64ffb21b
(cherry picked from commit 788019eb git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git

)
Signed-off-by: default avatarBart Van Assche <bvanassche@google.com>
parent 6baa3661
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment