Commit 84ec048b authored by Adrian Hunter's avatar Adrian Hunter Committed by Ulf Hansson

mmc: sdhci: Fix to handle MMC_POWER_UNDEFINED

Since commit c2c24819 ("mmc: core: Don't power off the card when
starting the host"), the power state can still be MMC_POWER_UNDEFINED after
mmc_start_host() is called. That can trigger a warning in SDHCI during
runtime resume as it tries to restore the I/O state. Handle
MMC_POWER_UNDEFINED simply by not updating the I/O state in that case.

Fixes: c2c24819 ("mmc: core: Don't power off the card when starting the host")
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 5b311c15
...@@ -1576,6 +1576,9 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -1576,6 +1576,9 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
unsigned long flags; unsigned long flags;
u8 ctrl; u8 ctrl;
if (ios->power_mode == MMC_POWER_UNDEFINED)
return;
spin_lock_irqsave(&host->lock, flags); spin_lock_irqsave(&host->lock, flags);
if (host->flags & SDHCI_DEVICE_DEAD) { if (host->flags & SDHCI_DEVICE_DEAD) {
...@@ -2938,6 +2941,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) ...@@ -2938,6 +2941,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host)
sdhci_init(host, 0); sdhci_init(host, 0);
if (mmc->ios.power_mode != MMC_POWER_UNDEFINED) {
/* Force clock and power re-program */ /* Force clock and power re-program */
host->pwr = 0; host->pwr = 0;
host->clock = 0; host->clock = 0;
...@@ -2954,6 +2958,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) ...@@ -2954,6 +2958,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host)
if ((mmc->caps2 & MMC_CAP2_HS400_ES) && if ((mmc->caps2 & MMC_CAP2_HS400_ES) &&
mmc->ops->hs400_enhanced_strobe) mmc->ops->hs400_enhanced_strobe)
mmc->ops->hs400_enhanced_strobe(mmc, &mmc->ios); mmc->ops->hs400_enhanced_strobe(mmc, &mmc->ios);
}
spin_lock_irqsave(&host->lock, flags); spin_lock_irqsave(&host->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment