OSDN Git Service

mmc: block: Fix issue with deferred resume when CQ is enabled
authorSahitya Tummala <stummala@codeaurora.org>
Wed, 30 Nov 2016 03:30:53 +0000 (09:00 +0530)
committerGerrit - the friendly Code Review server <code-review@localhost>
Mon, 19 Dec 2016 06:16:50 +0000 (22:16 -0800)
In CQ mode, the legacy commands will be sent after CQ is
put in halt state. But when deferred resume is enabled,
the resume happens in mmc_wait_for_req(), which will enable
CQ again overiding the caller's state. This causes legacy
commands to fail. Fix this by moving the deferred resume
from all the places to mmc_get_card() which is always the
first step done in both CQ/legacy commands and thus avoids
the above issue scneario.

Change-Id: I432e89f3221615dd644412f481d17f840c75e407
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
drivers/mmc/card/block.c
drivers/mmc/core/core.c

index 39cb46a..98043df 100644 (file)
@@ -3849,10 +3849,6 @@ static int mmc_blk_cmdq_issue_rq(struct mmc_queue *mq, struct request *req)
 
        mmc_get_card(card);
 
-#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME
-       if (mmc_bus_needs_resume(card->host))
-               mmc_resume_bus(card->host);
-#endif
        if (!card->host->cmdq_ctx.active_reqs && mmc_card_doing_bkops(card)) {
                ret = mmc_cmdq_halt(card->host, true);
                if (ret)
index 6ad9104..caf7617 100644 (file)
@@ -2128,6 +2128,10 @@ void mmc_get_card(struct mmc_card *card)
 {
        pm_runtime_get_sync(&card->dev);
        mmc_claim_host(card->host);
+#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME
+       if (mmc_bus_needs_resume(card->host))
+               mmc_resume_bus(card->host);
+#endif
 }
 EXPORT_SYMBOL(mmc_get_card);