spi: dw-mid: terminate ongoing transfers at exit
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 18 Sep 2014 17:08:53 +0000 (20:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Oct 2014 16:35:12 +0000 (09:35 -0700)
commit 8e45ef682cb31fda62ed4eeede5d9745a0a1b1e2 upstream.

Do full clean up at exit, means terminate all ongoing DMA transfers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-dw-mid.c

index b8ac40c8a22d26db5018020f3e1aca4365338085..0791c92e8c505cc9a35158bcdcdf0a7612ae92de 100644 (file)
@@ -91,7 +91,11 @@ static void mid_spi_dma_exit(struct dw_spi *dws)
 {
        if (!dws->dma_inited)
                return;
+
+       dmaengine_terminate_all(dws->txchan);
        dma_release_channel(dws->txchan);
+
+       dmaengine_terminate_all(dws->rxchan);
        dma_release_channel(dws->rxchan);
 }