diff options
| author | seteiro <[email protected]> | 2026-11-12 00:55:32 +0800 |
|---|---|---|
| committer | Rbb666 <[email protected]> | 2026-11-23 10:51:45 +0800 |
| commit | cde255bc54cbfa3d9eb3eec518953a0aded60e82 (patch) | |
| tree | 01ed8f473efa90135f6e49292b6cbba3ad31981c /bsp | |
| parent | 8bfdb9714f7e235cbe53498377b414aee94b3666 (diff) | |
[drivers][pin] publish legacy ISR handler under pin_irq_lock protection
Fix #11784
When the GPIO controller has no pin_attach_irq operation, pin_api_attach_irq()
writes legacy_isr->hdr and legacy_isr->args as two independent stores. An
interrupt arriving concurrently could make pin_pic_handle_isr() call the new
handler with the old argument.
Protect legacy_isr updates and clears in pin_api_attach_irq() and
pin_api_detach_irq() with a dedicated spinlock pin_irq_lock (via
rt_spin_lock_irqsave). In pin_pic_handle_isr(), snapshot the hdr and args
fields under pin_irq_lock, then invoke the callback after releasing the
lock to avoid executing user handlers while holding the spinlock.
Diffstat (limited to 'bsp')
0 files changed, 0 insertions, 0 deletions
