aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2016-05-04 03:38:21 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2016-05-04 07:11:53 -0400
commit437db4c6e79881d33aca521987188c728df350a8 (patch)
tree785b062054459efd6c6dfbf52d703a6c6917a926 /drivers/mmc
parentf3f44d512cafef7e3d2cb140f642786dd6ec8818 (diff)
mmc: mmc: Attempt to flush cache before reset
CMD0 or hardware reset may invalidate the cache, so it needs to be flushed before reset. In the case of recovery, we can't expect flushing the cache to work always, but have a go and ignore errors. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/mmc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 28b477d397b1..f99c47e003fe 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1958,6 +1958,12 @@ static int mmc_reset(struct mmc_host *host)
1958{ 1958{
1959 struct mmc_card *card = host->card; 1959 struct mmc_card *card = host->card;
1960 1960
1961 /*
1962 * In the case of recovery, we can't expect flushing the cache to work
1963 * always, but we have a go and ignore errors.
1964 */
1965 mmc_flush_cache(host->card);
1966
1961 if ((host->caps & MMC_CAP_HW_RESET) && host->ops->hw_reset && 1967 if ((host->caps & MMC_CAP_HW_RESET) && host->ops->hw_reset &&
1962 mmc_can_reset(card)) { 1968 mmc_can_reset(card)) {
1963 /* If the card accept RST_n signal, send it. */ 1969 /* If the card accept RST_n signal, send it. */