summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSahitya Tummala <stummala@codeaurora.org>2015-09-10 11:26:59 +0530
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:27:44 -0700
commite3a22cb14423fa5189393214e55ad50db03b7710 (patch)
treef2e15832e7cde275d651772e5a51688340d16c46
parent4463dc76685b8e2702501502b0c4a4f03ac82e95 (diff)
mmc: core: Fix CQ runtime suspend
Fix the timeout issue with mmc_cmdq_halt() that happens in the below scenario - 1. Let us say an RPMB request is processed just before the runtime suspend. The RPMB request will put the controller in HALT state and will put the card in legacy mode. 2. So during runtime suspend, the SW will check for card's state and since it is in legacy mode, it won't call CQ disable host->op. But CQ HW will get reset due to SW reset that gets issued during suspend. 3. If we get another RPMB request, we try to do the runtime resume. But since SW did not invoke CQ disable host->op, it thinks that CQ is still enabled and returns here without enabling CQ. 4. Now the RPMB request tries to put the controller in HALT state but timesout since CQ is still not enabled. Fix this issue by checking for host->card->cmdq_init to determine if the controller is initialized in CQ mode instead of checking for card's state in runtime suspend. This will ensure CQ will be disabled as part of runtime suspend and will be enabled again during runtime resume. Change-Id: I26bf97962d31522a9cb25009c6a048dfff6e4535 Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
-rw-r--r--drivers/mmc/core/mmc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 602dfb3a2b1d..65b2581e3195 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -2436,7 +2436,7 @@ static int _mmc_suspend(struct mmc_host *host, bool is_suspend)
if (is_suspend)
host->dev_status = DEV_SUSPENDING;
- if (mmc_card_cmdq(host->card)) {
+ if (host->card->cmdq_init) {
BUG_ON(host->cmdq_ctx.active_reqs);
err = mmc_cmdq_halt(host, true);