summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/mmc.c
diff options
context:
space:
mode:
authorAndrew Gabbasov <andrew_gabbasov@mentor.com>2014-04-03 04:34:32 -0500
committerPantelis Antoniou <panto@antoniou-consulting.com>2014-05-23 11:34:33 +0300
commit6b2221b008e0ea66de5befab38515e1a38c74d4f (patch)
treed318147bba7167738a8b1293c91a9d5c665e09a9 /drivers/mmc/mmc.c
parentd803fea576c0b9caf2ece1ea1fac0550d3508a4d (diff)
downloadtalos-obmc-uboot-6b2221b008e0ea66de5befab38515e1a38c74d4f.tar.gz
talos-obmc-uboot-6b2221b008e0ea66de5befab38515e1a38c74d4f.zip
mmc: Handle switch error status bit in MMC card status
MMC switch command for unsupported feature (e.g. bus width) sets a switch error bit in card status. This bit should be checked, and, if it's set, no access with new controller settings should be performed. Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com> Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Diffstat (limited to 'drivers/mmc/mmc.c')
-rw-r--r--drivers/mmc/mmc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 0c9ae5d9cd..bb9014dc06 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -150,6 +150,8 @@ int mmc_send_status(struct mmc *mmc, int timeout)
#endif
return TIMEOUT;
}
+ if (cmd.response[0] & MMC_STATUS_SWITCH_ERROR)
+ return SWITCH_ERR;
return 0;
}
@@ -501,7 +503,7 @@ static int mmc_change_freq(struct mmc *mmc)
err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, 1);
if (err)
- return err;
+ return err == SWITCH_ERR ? 0 : err;
/* Now check to see that it worked */
err = mmc_send_ext_csd(mmc, ext_csd);
OpenPOWER on IntegriCloud