diff options
| author | Sumit Saxena <[email protected]> | 2021-09-29 18:10:20 +0530 |
|---|---|---|
| committer | Martin K. Petersen <[email protected]> | 2021-10-04 23:20:09 -0400 |
| commit | e7dcc514a49e74051b869697d5ab0370f6301d57 (patch) | |
| tree | 5eff60ebc604f6e767becf88c2138a3217848e65 /tools/perf/scripts/python/flamegraph.py | |
| parent | d4996c6eac4c81b8872043e9391563f67f13e406 (diff) | |
scsi: megaraid_sas: Fix concurrent access to ISR between IRQ polling and real interrupt
IRQ polling thread calls ISR after enable_irq() to handle any missed I/O
completion. The atomic flag "in_used" was added to have the synchronization
between the IRQ polling thread and the interrupt context. There is a bug
around it leading to a race condition.
Below is the sequence:
- IRQ polling thread accesses ISR, fetches the reply descriptor.
- Real interrupt arrives and pre-empts polling thread (enable_irq() is
already called).
- Interrupt context picks the same reply descriptor as fetched by polling
thread, processes it, and exits.
- Polling thread resumes and processes the descriptor which is already
processed by interrupt thread leads to kernel crash.
Setting the "in_used" flag before fetching the reply descriptor ensures
synchronized access to ISR.
Link: https://www.spinics.net/lists/linux-scsi/msg159440.html
Link: https://lore.kernel.org/r/[email protected]
Fixes: 9bedd36e9146 ("scsi: megaraid_sas: Handle missing interrupts while re-enabling IRQs")
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions