OSDN Git Service

mmc: block: support RPMB with CMDQ framework
authorSahitya Tummala <stummala@codeaurora.org>
Wed, 20 May 2015 06:45:35 +0000 (12:15 +0530)
committerSubhash Jadavani <subhashj@codeaurora.org>
Tue, 31 May 2016 22:26:38 +0000 (15:26 -0700)
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>
drivers/mmc/card/block.c
drivers/mmc/card/queue.c

index cbf798b..5e29a8d 100644 (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,
index 98afbee..e99b1cf 100644 (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);