aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/host
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-02-14 12:15:57 +0000
committerMark Brown <broonie@linaro.org>2014-02-14 12:15:57 +0000
commit6a7fe00e1f5a2e77b777b6e3b90c924c95bfa866 (patch)
tree1446c710e4a76d79fe11b1fa01ccb508f0d12d67 /drivers/mmc/host
parentccf1801b089f5575144c4346e4d7d3883a6c9163 (diff)
parent8415e604452966f981f20cb4d8a8a30e38a772dd (diff)
Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-androidlinux-linaro-lsk-v3.10-androidlinux-linaro-lsk-android
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/atmel-mci.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index b5c95043f7e..84b054b0846 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1188,11 +1188,22 @@ static void atmci_start_request(struct atmel_mci *host,
iflags |= ATMCI_CMDRDY;
cmd = mrq->cmd;
cmdflags = atmci_prepare_command(slot->mmc, cmd);
- atmci_send_command(host, cmd, cmdflags);
+
+ /*
+ * DMA transfer should be started before sending the command to avoid
+ * unexpected errors especially for read operations in SDIO mode.
+ * Unfortunately, in PDC mode, command has to be sent before starting
+ * the transfer.
+ */
+ if (host->submit_data != &atmci_submit_data_dma)
+ atmci_send_command(host, cmd, cmdflags);
if (data)
host->submit_data(host, data);
+ if (host->submit_data == &atmci_submit_data_dma)
+ atmci_send_command(host, cmd, cmdflags);
+
if (mrq->stop) {
host->stop_cmdr = atmci_prepare_command(slot->mmc, mrq->stop);
host->stop_cmdr |= ATMCI_CMDR_STOP_XFER;