提交 437db4c6 编写于 作者: A Adrian Hunter 提交者: Ulf Hansson

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: NAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 f3f44d51
......@@ -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. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册