summaryrefslogtreecommitdiff
path: root/drivers/mmc/core
diff options
context:
space:
mode:
authorHaibo Chen <haibo.chen@nxp.com>2018-03-21 18:26:46 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit2664e4b95813010e7d7c2285141b959f01d7ddde (patch)
treec8d92874d807f3b1b95532d259155624c015ae1a /drivers/mmc/core
parent2cca9221d074b6a788a86c8954753bcdd641b8e3 (diff)
MLK-17883 mmc: add delay after CMD6 before sending CMD13
Android report data timeout issue on the Micron eMMC of i.mx8mscale evk board. Before using CMD25 to write multi block data, driver will use CMD6 to flush cache. But some CMD25 will get both data timeout interrupt and transfer complete interrupt. If add delay after busy check, and before sending CMD13, this issue gone. We meet similar issue on Sandisk eMMC before, and already have a commit 581925fe325a ("MLK-11685-1 mmc: add delay after CMD6 befoer sending CMD13 for sandisk"), but when cherry-pick to 4.9 branch, meet conflicts, put the delay in the wrong place. So meet the similar issue again. This patch fix this, move the dealy in the right place, right before CMD13. Reviewed-by: Dong Aisheng <Aisheng.dong@nxp.com> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r--drivers/mmc/core/mmc_ops.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index e29d28f7b92d..bd6dfd425b7c 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -574,12 +574,6 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
if (!use_busy_signal)
goto out;
- /*
- * WORKAROUND: for Sandisk eMMC cards, it might need certain delay
- * before sending CMD13 after CMD6
- */
- mdelay(1);
-
/*If SPI or used HW busy detection above, then we don't need to poll. */
if (((host->caps & MMC_CAP_WAIT_WHILE_BUSY) && use_r1b_resp) ||
mmc_host_is_spi(host))
@@ -595,6 +589,12 @@ out_tim:
if (timing)
mmc_set_timing(host, timing);
+ /*
+ * WORKAROUND: for Sandisk eMMC cards, it might need certain delay
+ * before sending CMD13 after CMD6
+ */
+ mdelay(1);
+
if (send_status) {
err = mmc_switch_status(card);
if (err && timing)