Adrian Hunter
f0b5159637
i3c: mipi-i3c-hci: Fix race between DMA ring dequeue and interrupt handler
...
The DMA ring bookkeeping in the MIPI I3C HCI driver is updated from two
contexts: the DMA ring dequeue path (hci_dma_dequeue_xfer()) and the
interrupt handler (hci_dma_xfer_done()). Both modify the ring's
in-flight transfer state - specifically rh->src_xfers[] and
xfer->ring_entry - but without any serialization. This allows the two
paths to race, potentially leading to inconsistent ring state.
Serialize access to the shared ring state by extending the existing
spinlock to cover the DMA dequeue path and the entire interrupt handler.
Since the core IRQ handler now holds this lock, remove the per-function
locking from the PIO and DMA sub-handlers.
Additionally, clear the completed entry in rh->src_xfers[] in
hci_dma_xfer_done() so it cannot be matched or completed again.
Finally, place the ring restart sequence under the same lock in
hci_dma_dequeue_xfer() to avoid concurrent enqueue or completion
operations while the ring state is being modified.
Fixes: 9ad9a52cce ("i3c/master: introduce the mipi-i3c-hci driver")
Cc: stable@vger.kernel.org
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Reviewed-by: Frank Li <Frank.Li@nxp.com >
Link: https://patch.msgid.link/20260306072451.11131-8-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com >
2026-03-11 22:10:01 +01:00
..
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-02-22 08:26:33 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 01:02:28 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-27 16:33:07 +01:00
2026-02-10 20:45:30 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 20:03:00 -08:00
2026-03-11 22:10:01 +01:00
2026-02-27 16:33:07 +01:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 01:02:28 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-27 16:33:07 +01:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 11:02:58 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 09:43:11 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 20:03:00 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-02-22 08:26:33 -08:00
2026-02-21 17:09:51 -08:00
2026-02-04 20:45:26 +05:30