diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2013-10-10 17:22:23 +0200 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-10-30 20:28:43 -0400 |
commit | 4d22378221bd0ed69c2e99408d31c108d72aeb80 (patch) | |
tree | 298044ec52b46b7de410e924d85508f0abadee16 /drivers/mmc/core | |
parent | 0cb403a227774f60f6f52137ca3618805498c4e6 (diff) | |
download | op-kernel-dev-4d22378221bd0ed69c2e99408d31c108d72aeb80.zip op-kernel-dev-4d22378221bd0ed69c2e99408d31c108d72aeb80.tar.gz |
mmc: core: Add MMC_CAP_RUNTIME_RESUME to resume at runtime_resume
In some environments it is to prefer to postpone the resume of the card
device until runtime_resume is being carried out, since it will mean a
signficant decrease of the total system resume time.
The reason of the decreased resume time is simply because of the actual
re-initalization of the card, which typically takes hundreds of
milliseconds, is performed outside the resume sequence and wont thus
affect it.
For removable card, the detect work tries to re-detect the card to make
sure it is still present, as a part of that sequence the card will also
be runtime_resumed and thus also fully resumed.
For a non-removable card, typically a mmc blk request will trigger a
runtime_resume and thus fully resume the card. This also means the
first request will likely suffer from an inital latency since the
re-initialization of the card needs to be performed.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r-- | drivers/mmc/core/mmc.c | 12 | ||||
-rw-r--r-- | drivers/mmc/core/sd.c | 12 |
2 files changed, 14 insertions, 10 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 7f5dc26..f631f5a 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1577,11 +1577,13 @@ static int mmc_shutdown(struct mmc_host *host) */ static int mmc_resume(struct mmc_host *host) { - int err; + int err = 0; - err = _mmc_resume(host); - pm_runtime_set_active(&host->card->dev); - pm_runtime_mark_last_busy(&host->card->dev); + if (!(host->caps & MMC_CAP_RUNTIME_RESUME)) { + err = _mmc_resume(host); + pm_runtime_set_active(&host->card->dev); + pm_runtime_mark_last_busy(&host->card->dev); + } pm_runtime_enable(&host->card->dev); return err; @@ -1612,7 +1614,7 @@ static int mmc_runtime_resume(struct mmc_host *host) { int err; - if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) + if (!(host->caps & (MMC_CAP_AGGRESSIVE_PM | MMC_CAP_RUNTIME_RESUME))) return 0; err = _mmc_resume(host); diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 447fa8e..6f42050 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -1139,11 +1139,13 @@ out: */ static int mmc_sd_resume(struct mmc_host *host) { - int err; + int err = 0; - err = _mmc_sd_resume(host); - pm_runtime_set_active(&host->card->dev); - pm_runtime_mark_last_busy(&host->card->dev); + if (!(host->caps & MMC_CAP_RUNTIME_RESUME)) { + err = _mmc_sd_resume(host); + pm_runtime_set_active(&host->card->dev); + pm_runtime_mark_last_busy(&host->card->dev); + } pm_runtime_enable(&host->card->dev); return err; @@ -1174,7 +1176,7 @@ static int mmc_sd_runtime_resume(struct mmc_host *host) { int err; - if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) + if (!(host->caps & (MMC_CAP_AGGRESSIVE_PM | MMC_CAP_RUNTIME_RESUME))) return 0; err = _mmc_sd_resume(host); |