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>
This commit is contained in:
Sahitya Tummala 2015-05-20 12:15:35 +05:30 committed by Subhash Jadavani
parent 10fc703640
commit b8fc176b81
2 changed files with 13 additions and 1 deletions

View file

@ -1046,6 +1046,8 @@ static int mmc_blk_cmdq_switch(struct mmc_card *card,
{
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 ||
@ -1060,6 +1062,16 @@ static int mmc_blk_cmdq_switch(struct mmc_card *card,
__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,

View file

@ -62,7 +62,7 @@ static inline bool mmc_cmdq_should_pull_reqs(struct mmc_host *host,
{
if (((req->cmd_flags & (REQ_FLUSH | REQ_DISCARD)) &&
test_bit(CMDQ_STATE_DCMD_ACTIVE, &ctx->curr_state)) ||
mmc_host_halt(host) ||
(!host->card->part_curr && mmc_host_halt(host)) ||
test_bit(CMDQ_STATE_ERR, &ctx->curr_state)) {
pr_debug("%s: %s: skip pulling reqs: state: %lu\n",
mmc_hostname(host), __func__, ctx->curr_state);