Skip to content

Commit

Permalink
mmc: core: Make runtime resume default behavior for MMC/SD
Browse files Browse the repository at this point in the history
MMC_CAP_RUNTIME_RESUME was invented to decrease system PM resume time for
systems that particularly needs this. As the feature has matured let's
make it the default behavior for MMC/SD.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Ulf Hansson committed Dec 22, 2015
1 parent d234d21 commit c29536e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
15 changes: 2 additions & 13 deletions drivers/mmc/core/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1907,16 +1907,8 @@ static int mmc_shutdown(struct mmc_host *host)
*/
static int mmc_resume(struct mmc_host *host)
{
int err = 0;

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;
return 0;
}

/*
Expand Down Expand Up @@ -1944,12 +1936,9 @@ static int mmc_runtime_resume(struct mmc_host *host)
{
int err;

if (!(host->caps & (MMC_CAP_AGGRESSIVE_PM | MMC_CAP_RUNTIME_RESUME)))
return 0;

err = _mmc_resume(host);
if (err)
pr_err("%s: error %d doing aggressive resume\n",
pr_err("%s: error %d doing runtime resume\n",
mmc_hostname(host), err);

return 0;
Expand Down
15 changes: 2 additions & 13 deletions drivers/mmc/core/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,16 +1128,8 @@ static int _mmc_sd_resume(struct mmc_host *host)
*/
static int mmc_sd_resume(struct mmc_host *host)
{
int err = 0;

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;
return 0;
}

/*
Expand Down Expand Up @@ -1165,12 +1157,9 @@ static int mmc_sd_runtime_resume(struct mmc_host *host)
{
int err;

if (!(host->caps & (MMC_CAP_AGGRESSIVE_PM | MMC_CAP_RUNTIME_RESUME)))
return 0;

err = _mmc_sd_resume(host);
if (err)
pr_err("%s: error %d doing aggressive resume\n",
pr_err("%s: error %d doing runtime resume\n",
mmc_hostname(host), err);

return 0;
Expand Down

0 comments on commit c29536e

Please sign in to comment.