OSDN Git Service

spi: lpspi: add missing complete in abort func at dma mode
authorClark Wang <xiaoning.wang@nxp.com>
Tue, 2 Apr 2019 12:45:53 +0000 (12:45 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 3 Apr 2019 04:32:26 +0000 (11:32 +0700)
Add the missing complete operations for dma_completion to fix the
problem of blocking at the wait_for_completion_interruptible()
function when use spi_slave_abort().

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-lpspi.c

index 4de8eb3..2ad9d62 100644 (file)
@@ -482,7 +482,13 @@ static int fsl_lpspi_slave_abort(struct spi_controller *controller)
                                spi_controller_get_devdata(controller);
 
        fsl_lpspi->slave_aborted = true;
-       complete(&fsl_lpspi->xfer_done);
+       if (!fsl_lpspi->usedma)
+               complete(&fsl_lpspi->xfer_done);
+       else {
+               complete(&fsl_lpspi->dma_tx_completion);
+               complete(&fsl_lpspi->dma_rx_completion);
+       }
+
        return 0;
 }