All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: core: Attempt to flush cache before reset
@ 2016-04-28  7:48 Adrian Hunter
  2016-05-02  8:31 ` Ulf Hansson
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Hunter @ 2016-04-28  7:48 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc

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>
---
 drivers/mmc/core/core.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 99275e40bf2f..1b4e0ccb0885 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2453,6 +2453,12 @@ int mmc_hw_reset(struct mmc_host *host)
 		return -EOPNOTSUPP;
 	}
 
+	/*
+	 * 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);
+
 	ret = host->bus_ops->reset(host);
 	mmc_bus_put(host);
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-04 11:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-28  7:48 [PATCH] mmc: core: Attempt to flush cache before reset Adrian Hunter
2016-05-02  8:31 ` Ulf Hansson
2016-05-04  7:38   ` [PATCH V2] mmc: mmc: " Adrian Hunter
2016-05-04 11:13     ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.