aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@stericsson.com>2012-02-22 10:23:55 +0100
committerPhilippe Langlais <philippe.langlais@linaro.org>2012-03-06 17:30:17 +0100
commit49f546bd6d039cd80f1bcbacebbdf765e6b321a7 (patch)
treea39e9b1cc1ce2faa1ecdd42406517551b21dfaef
parent24fbdf9595af595c910b39c3aacf9b21c36166b3 (diff)
mmc: mmci: Do not finalize dma job at data error irq
mmci_dma_finalize must not be executed when a data error irq has been received. We do mmci_dma_unmap directly instead and moreover make sure the dma handles are reset as soon as the dma job is done/terminated. Change-Id: Ib4ed3f380f4383cb2a28613552569b950c5204a5 Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/49925 Reviewed-by: Per FORLIN <per.forlin@stericsson.com>
-rw-r--r--drivers/mmc/host/mmci.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index fdf36f550ae..5b4135fa9c3 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -378,6 +378,8 @@ static void mmci_dma_data_error(struct mmci_host *host)
{
dev_err(mmc_dev(host->mmc), "error during DMA transfer!\n");
dmaengine_terminate_all(host->dma_current);
+ host->dma_current = NULL;
+ host->dma_desc_current = NULL;
host->data->host_cookie = 0;
}
@@ -417,10 +419,8 @@ static void mmci_dma_finalize(struct mmci_host *host, struct mmc_data *data)
* contiguous buffers. On TX, we'll get a FIFO underrun error.
*/
if (status & MCI_RXDATAAVLBLMASK) {
- if (!data->error) {
- data->error = -EIO;
- mmci_dma_data_error(host);
- }
+ data->error = -EIO;
+ mmci_dma_data_error(host);
}
if (!data->host_cookie)
@@ -434,6 +434,9 @@ static void mmci_dma_finalize(struct mmci_host *host, struct mmc_data *data)
dev_err(mmc_dev(host->mmc), "buggy DMA detected. Taking evasive action.\n");
mmci_dma_release(host);
}
+
+ host->dma_current = NULL;
+ host->dma_desc_current = NULL;
}
/* prepares DMA channel and DMA descriptor, returns non-zero on failure */
@@ -776,8 +779,10 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data,
u32 remain, success;
/* Terminate the DMA transfer */
- if (dma_inprogress(host))
+ if (dma_inprogress(host)) {
mmci_dma_data_error(host);
+ mmci_dma_unmap(host, data);
+ }
/*
* Calculate how far we are into the transfer. Note that