mmc: block: fix partition switch failure observed during shutdown

If an RPMB request is the last request to be done before shutdown,
then the card will be already switched to legacy mode as part of
RPMB request handling. Later, in the shutdown handler, we get this
error if we try to switch to legacy mode again.

mmc0: failed to switch card to legacy mode: -74

CRs-Fixed: 935717
Change-Id: Ie75ba225412d0fecce9c98f07334b570a6cd5772
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
This commit is contained in:
Sahitya Tummala 2015-11-05 10:07:42 +05:30 committed by Subhash Jadavani
parent 421d4bfa08
commit 31c01a3450

View file

@ -3002,6 +3002,7 @@ static void mmc_blk_cmdq_shutdown(struct mmc_queue *mq)
}
/* disable CQ mode in card */
if (mmc_card_cmdq(card)) {
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
EXT_CSD_CMDQ, 0,
card->ext_csd.generic_cmd6_time);
@ -3009,11 +3010,11 @@ static void mmc_blk_cmdq_shutdown(struct mmc_queue *mq)
pr_err("%s: failed to switch card to legacy mode: %d\n",
__func__, err);
goto out;
} else {
}
mmc_card_clr_cmdq(card);
}
host->cmdq_ops->disable(host, false);
host->card->cmdq_init = false;
}
out:
mmc_host_clk_release(host);
mmc_put_card(card);