diff options
| author | Brian Norris <[email protected]> | 2025-05-14 20:13:16 +0000 |
|---|---|---|
| committer | Thomas Gleixner <[email protected]> | 2025-05-15 14:44:25 +0000 |
| commit | 788019eb559fd0b365f501467ceafce540e377cc (patch) | |
| tree | 95a7898f64b0bc215e3e0bfd23d366a67538432d /drivers/fpga/tests/fpga-mgr-test.c | |
| parent | genirq: Bump the size of the local variable for sprintf() (diff) | |
| download | kernel-788019eb559fd0b365f501467ceafce540e377cc.tar.gz kernel-788019eb559fd0b365f501467ceafce540e377cc.zip | |
genirq: Retain disable depth for managed interrupts across CPU hotplug
Affinity-managed interrupts can be shut down and restarted during CPU
hotunplug/plug. Thereby the interrupt may be left in an unexpected state.
Specifically:
1. Interrupt is affine 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! driver expects that the interrupt
still disabled)
7. enable_irq() -> depth underflow / unbalanced enable_irq() warning
This is only a problem for managed interrupts and CPU hotplug, all other
cases like request()/free()/request() truly needs to reset a possibly stale
disable depth value.
Provide a startup function, which takes the disable depth into account, and
invoked it for the managed interrupts in the CPU hotplug path.
This requires to change irq_shutdown() to do a depth increment instead of
setting it to 1, which allows to retain the disable depth, but is harmless
for the other code paths using irq_startup(), which will still reset the
disable depth unconditionally to keep the original correct behaviour.
A kunit tests will be added separately to cover some of these aspects.
[ tglx: Massaged changelog ]
Suggested-by: Thomas Gleixner <[email protected]>
Signed-off-by: Brian Norris <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/all/[email protected]
Diffstat (limited to 'drivers/fpga/tests/fpga-mgr-test.c')
0 files changed, 0 insertions, 0 deletions
