summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/tmio_mmc_dma.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2012-01-06 13:06:51 +0100
committerChris Ball <cjb@laptop.org>2012-02-13 20:39:03 -0500
commite3de2be7368d2983bd7f7ddb6e9cf5ea32363128 (patch)
tree810c6a3d5fe404ebbe98f98561b1b9b49ac6e4fb /drivers/mmc/host/tmio_mmc_dma.c
parentdd13b4ed4650bb3a7d6c86b549ab66a6aa0c00d8 (diff)
mmc: tmio_mmc: fix card eject during IO with DMA
When DMA is in use and the card is ejected during IO, DMA transfers have to be terminated, otherwise the dmaengine driver fails to operate properly, when the card is re-inserted. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/tmio_mmc_dma.c')
-rw-r--r--drivers/mmc/host/tmio_mmc_dma.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 7a6e6cc8f8b8..8253ec12003e 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -34,6 +34,18 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
#endif
}
+void tmio_mmc_abort_dma(struct tmio_mmc_host *host)
+{
+ tmio_mmc_enable_dma(host, false);
+
+ if (host->chan_rx)
+ dmaengine_terminate_all(host->chan_rx);
+ if (host->chan_tx)
+ dmaengine_terminate_all(host->chan_tx);
+
+ tmio_mmc_enable_dma(host, true);
+}
+
static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host)
{
struct scatterlist *sg = host->sg_ptr, *sg_tmp;