From 038efe2377e555ed654c078e04984363ec832435 Mon Sep 17 00:00:00 2001 From: Clark Wang Date: Tue, 2 Apr 2019 19:51:49 +0800 Subject: [PATCH] MLK-21313 spi: lpspi: add missing complete in abort func at dma mode Add the missing complete operations for dma_completion to fix the problem of blocking at the wait_for_completion_interruptible() function in some situations. Signed-off-by: Clark Wang (cherry picked from commit a19a00c51df5c3ead4d64ea3136f5bce60b2e6af) --- drivers/spi/spi-fsl-lpspi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-fsl-lpspi.c b/drivers/spi/spi-fsl-lpspi.c index 4a839626ec62..0c38d7927b50 100644 --- a/drivers/spi/spi-fsl-lpspi.c +++ b/drivers/spi/spi-fsl-lpspi.c @@ -476,7 +476,12 @@ 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; } -- 2.17.1