All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: blk: add emmc cache flush in shutdown callback
@ 2014-07-14  9:34 Yunpeng Gao
  2014-07-14  9:51 ` Jaehoon Chung
  0 siblings, 1 reply; 3+ messages in thread
From: Yunpeng Gao @ 2014-07-14  9:34 UTC (permalink / raw)
  To: linux-mmc; +Cc: Yunpeng Gao

If eMMC Cache feature enabled, we'd better flush
eMMC cache in the shutdown callback. Otherwise
data corruption issue may be observed.

Signed-off-by: Yunpeng Gao <yunpeng.gao@intel.com>
---
 drivers/mmc/card/block.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 452782b..8a4010e 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -2509,6 +2509,10 @@ static int _mmc_blk_suspend(struct mmc_card *card)
 static void mmc_blk_shutdown(struct mmc_card *card)
 {
 	_mmc_blk_suspend(card);
+
+	mmc_claim_host(card->host);
+	mmc_flush_cache(card);
+	mmc_release_host(card->host);
 }
 
 #ifdef CONFIG_PM
-- 
1.7.9.5


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

end of thread, other threads:[~2014-07-14 11:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-14  9:34 [PATCH] mmc: blk: add emmc cache flush in shutdown callback Yunpeng Gao
2014-07-14  9:51 ` Jaehoon Chung
2014-07-14 11:09   ` Gao, Yunpeng

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.