Skip to content

Commit 826b3a6

Browse files
vladimirolteanbroonie
authored andcommitted
spi: spi-fsl-dspi: Fix interrupt-less DMA mode taking an XSPI code path
Interrupts are not necessary for DMA functionality, since the completion event is provided by the DMA driver. But if the driver fails to request the IRQ defined in the device tree, it will call dspi_poll which would make the driver hang waiting for data to become available in the RX FIFO. Fixes: c55be30 ("spi: spi-fsl-dspi: Use poll mode in case the platform IRQ is missing") Signed-off-by: Vladimir Oltean <[email protected]> Tested-by: Michael Walle <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 3d6224e commit 826b3a6

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

drivers/spi/spi-fsl-dspi.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -965,13 +965,15 @@ static int dspi_transfer_one_message(struct spi_controller *ctlr,
965965
goto out;
966966
}
967967

968-
if (!dspi->irq) {
969-
do {
970-
status = dspi_poll(dspi);
971-
} while (status == -EINPROGRESS);
972-
} else if (trans_mode != DSPI_DMA_MODE) {
973-
wait_for_completion(&dspi->xfer_done);
974-
reinit_completion(&dspi->xfer_done);
968+
if (trans_mode != DSPI_DMA_MODE) {
969+
if (dspi->irq) {
970+
wait_for_completion(&dspi->xfer_done);
971+
reinit_completion(&dspi->xfer_done);
972+
} else {
973+
do {
974+
status = dspi_poll(dspi);
975+
} while (status == -EINPROGRESS);
976+
}
975977
}
976978

977979
spi_transfer_delay_exec(transfer);

0 commit comments

Comments
 (0)