summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/mmc.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2016-05-04 10:38:21 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2016-05-04 13:11:53 +0200
commit437db4c6e79881d33aca521987188c728df350a8 (patch)
tree785b062054459efd6c6dfbf52d703a6c6917a926 /drivers/mmc/core/mmc.c
parentf3f44d512cafef7e3d2cb140f642786dd6ec8818 (diff)
downloadop-kernel-dev-437db4c6e79881d33aca521987188c728df350a8.zip
op-kernel-dev-437db4c6e79881d33aca521987188c728df350a8.tar.gz
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/core/mmc.c')
-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 28b477d..f99c47e 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)
{
struct mmc_card *card = host->card;
+ /*
+ * In the case of recovery, we can't expect flushing the cache to work
+ * always, but we have a go and ignore errors.
+ */
+ mmc_flush_cache(host->card);
+
if ((host->caps & MMC_CAP_HW_RESET) && host->ops->hw_reset &&
mmc_can_reset(card)) {
/* If the card accept RST_n signal, send it. */
OpenPOWER on IntegriCloud