mmc: block: support RPMB with CMDQ framework
CMDQ is not supported for RPMB partition. Hence, for RPMB requests
the controller is kept in HALT state and then CMDQ is disabled in
the card.
Change-Id: I1242841d5fa063b542e35dcff95694ef5e88737a
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
[xiaonian@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Xiaonian Wang <xiaonian@codeaurora.org>
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index d476d9a..10dbfd6 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1307,6 +1307,8 @@
{
int ret = 0;
bool cmdq_mode = !!mmc_card_cmdq(card);
+ struct mmc_host *host = card->host;
+ struct mmc_cmdq_context_info *ctx = &host->cmdq_ctx;
if (!(card->host->caps2 & MMC_CAP2_CMD_QUEUE) ||
!card->ext_csd.cmdq_support ||
@@ -1321,6 +1323,16 @@
__func__, ret, MMC_CARD_CMDQ_BLK_SIZE);
goto out;
}
+
+ } else {
+ if (!test_bit(CMDQ_STATE_HALT, &ctx->curr_state)) {
+ ret = mmc_cmdq_halt(host, true);
+ if (ret) {
+ pr_err("%s: halt: failed: %d\n",
+ mmc_hostname(host), ret);
+ goto out;
+ }
+ }
}
ret = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,