summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2020-03-18 02:15:59 +0200
committerMark Brown <broonie@kernel.org>2020-03-18 22:44:59 +0000
commit826b3a6a34619b934cdc33eeb961fcb99ce92c09 (patch)
treeee9a76d18feb98fe8c049dacbc265955f294da4e /drivers/spi
parent3d6224e63be39ff26cf416492cb3923cd3d07dd0 (diff)
downloadlinux-826b3a6a34619b934cdc33eeb961fcb99ce92c09.tar.gz
linux-826b3a6a34619b934cdc33eeb961fcb99ce92c09.tar.bz2
linux-826b3a6a34619b934cdc33eeb961fcb99ce92c09.zip
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: c55be3059159 ("spi: spi-fsl-dspi: Use poll mode in case the platform IRQ is missing") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Tested-by: Michael Walle <michael@walle.cc> Link: https://lore.kernel.org/r/20200318001603.9650-9-olteanv@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-fsl-dspi.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index 81e22b6eadc7..fcc6f20b6631 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -965,13 +965,15 @@ static int dspi_transfer_one_message(struct spi_controller *ctlr,
goto out;
}
- if (!dspi->irq) {
- do {
- status = dspi_poll(dspi);
- } while (status == -EINPROGRESS);
- } else if (trans_mode != DSPI_DMA_MODE) {
- wait_for_completion(&dspi->xfer_done);
- reinit_completion(&dspi->xfer_done);
+ if (trans_mode != DSPI_DMA_MODE) {
+ if (dspi->irq) {
+ wait_for_completion(&dspi->xfer_done);
+ reinit_completion(&dspi->xfer_done);
+ } else {
+ do {
+ status = dspi_poll(dspi);
+ } while (status == -EINPROGRESS);
+ }
}
spi_transfer_delay_exec(transfer);