spi: imx: terminate RX DMA transaction in case of TX DMA timeout
authorAnton Bondarenko <anton.bondarenko.sama@gmail.com>
Sat, 5 Dec 2015 16:56:59 +0000 (17:56 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 7 Dec 2015 19:53:35 +0000 (19:53 +0000)
Not only TX DMA should be terminated, but RX DMA also. It's required
to avoid accidential DMA memory writes from RX DMA channel and properly
terminate transaction.

Signed-off-by: Anton Bondarenko <anton.bondarenko.sama@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-imx.c

index e7e4f0c0f14d88500c9ded9a8857a664b75c7624..d6dc665428116415070ee470b1d7873fcc2852d3 100644 (file)
@@ -968,6 +968,7 @@ static int spi_imx_dma_transfer(struct spi_imx_data *spi_imx,
                        dev_driver_string(&master->dev),
                        dev_name(&master->dev));
                dmaengine_terminate_all(master->dma_tx);
+               dmaengine_terminate_all(master->dma_rx);
        } else {
                timeout = wait_for_completion_timeout(
                                &spi_imx->dma_rx_completion, IMX_DMA_TIMEOUT);