Skip to content

Commit

Permalink
mmc: core: Enable / disable re-tuning
Browse files Browse the repository at this point in the history
Enable re-tuning when tuning is executed and
disable re-tuning when card is no longer initialized.

In the case of SDIO suspend, the card can keep power.
In that case, re-tuning need not be disabled, but, if
a re-tuning timer is being used, ensure it is disabled
and assume that re-tuning will be needed upon resume
since it is not known how long the suspend will last.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Adrian Hunter authored and Ulf Hansson committed Jun 1, 2015
1 parent dfa13eb commit 79d5a65
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,8 @@ int mmc_execute_tuning(struct mmc_card *card)

if (err)
pr_err("%s: tuning execution failed\n", mmc_hostname(host));
else
mmc_retune_enable(host);

return err;
}
Expand Down Expand Up @@ -1140,6 +1142,8 @@ void mmc_set_bus_width(struct mmc_host *host, unsigned int width)
*/
void mmc_set_initial_state(struct mmc_host *host)
{
mmc_retune_disable(host);

if (mmc_host_is_spi(host))
host->ios.chip_select = MMC_CS_HIGH;
else
Expand Down
6 changes: 5 additions & 1 deletion drivers/mmc/core/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,8 +934,12 @@ static int mmc_sdio_suspend(struct mmc_host *host)
mmc_release_host(host);
}

if (!mmc_card_keep_power(host))
if (!mmc_card_keep_power(host)) {
mmc_power_off(host);
} else if (host->retune_period) {
mmc_retune_timer_stop(host);
mmc_retune_needed(host);
}

return 0;
}
Expand Down

0 comments on commit 79d5a65

Please sign in to comment.