Skip to content

Commit 6ca2738

Browse files
jhnikulaalexandrebelloni
authored andcommitted
i3c: mipi-i3c-hci: Mask ring interrupts before ring stop request
Bus cleanup path in DMA mode may trigger a RING_OP_STAT interrupt when the ring is being stopped. Depending on timing between ring stop request completion, interrupt handler removal and code execution this may lead to a NULL pointer dereference in hci_dma_irq_handler() if it gets to run after the io_data pointer is set to NULL in hci_dma_cleanup(). Prevent this my masking the ring interrupts before ring stop request. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Link: https://lore.kernel.org/r/20240920144432.62370-2-jarkko.nikula@linux.intel.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 3082990 commit 6ca2738

File tree

1 file changed

+1
-1
lines changed
  • drivers/i3c/master/mipi-i3c-hci

1 file changed

+1
-1
lines changed

drivers/i3c/master/mipi-i3c-hci/dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ static void hci_dma_cleanup(struct i3c_hci *hci)
159159
for (i = 0; i < rings->total; i++) {
160160
rh = &rings->headers[i];
161161

162+
rh_reg_write(INTR_SIGNAL_ENABLE, 0);
162163
rh_reg_write(RING_CONTROL, 0);
163164
rh_reg_write(CR_SETUP, 0);
164165
rh_reg_write(IBI_SETUP, 0);
165-
rh_reg_write(INTR_SIGNAL_ENABLE, 0);
166166

167167
if (rh->xfer)
168168
dma_free_coherent(&hci->master.dev,

0 commit comments

Comments
 (0)