]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
spi: mxs: Terminate DMA in case of DMA timeout
authorMarek Vasut <marex@denx.de>
Sun, 14 Oct 2012 02:32:56 +0000 (04:32 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 17 Oct 2012 07:11:09 +0000 (16:11 +0900)
In case the SPI DMA times out, the DMA might still be in some kind of
inconsistent state. Issue dmaengine_terminate_all() on the particular
channel to kill off all operations before continuing.

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/spi/spi-mxs.c

index 5a63bcd7a23d464bdbd26f231250a560e10ff9a5..86dd04d6bc873dfa30f0bab1148bd863aac818fc 100644 (file)
@@ -323,6 +323,7 @@ static int mxs_spi_txrx_dma(struct mxs_spi *spi, int cs,
        if (!ret) {
                dev_err(ssp->dev, "DMA transfer timeout\n");
                ret = -ETIMEDOUT;
+               dmaengine_terminate_all(ssp->dmach);
                goto err_vmalloc;
        }