summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsutosh Das <asutoshd@codeaurora.org>2013-10-14 11:35:19 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-02 01:31:34 -0800
commit3059e03a6b8d623bc82c9dfb42483ddee3350c96 (patch)
tree56f364ae73a2332dd65d149472a2d60642a4e9a8
parent613765204325713b6419765d5d27e7b8f633ef59 (diff)
mmc: core: add deferred resume support
This patch enables the deferred resume support which would prevent initialization of the card each time the system resumes. With this change, the resume process would only be initiated if a request is received. Following scenario can occur: 1. device runtime suspended, system suspend is triggered When resumed, the device would not be resumed until a request is received. 2. device is runtime active, system suspend is triggered When resumed, the device would be marked as BUS_NEEDS_RESUME and actual resume would happen, when a request is received. At this point, the device may also enter runtime-suspend or system suspend may also occur. In both the cases, since the device has not been resumed, it won't be suspended again. However, the platform device would be runtime suspended and resumed as before. It can so happen that the card is removed even before a request is received. In this case the device would be resumed and card would be removed from core layer and upper layers would be notified. In case of SDIO cards, this change would not have any effect since manual resume would be enabled for devices supporting a block read/write commands. CRs-Fixed: 561382 Change-Id: Id39befea109ee24864dfde0898395b972d0a1b3a Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
-rw-r--r--drivers/mmc/core/core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index a444a3a80f52..152a3e3b4f47 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1748,6 +1748,10 @@ EXPORT_SYMBOL(mmc_start_req);
*/
void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq)
{
+#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME
+ if (mmc_bus_needs_resume(host))
+ mmc_resume_bus(host);
+#endif
__mmc_start_req(host, mrq);
mmc_wait_for_req_done(host, mrq);
}
@@ -3105,9 +3109,6 @@ int mmc_resume_bus(struct mmc_host *host)
}
}
- if (host->bus_ops->detect && !host->bus_dead)
- host->bus_ops->detect(host);
-
mmc_bus_put(host);
pr_debug("%s: Deferred resume completed\n", mmc_hostname(host));
return 0;