aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2016-12-19 08:33:11 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2016-12-20 05:42:33 -0500
commit84ec048ba133c2a570273e90622d8fac4930553e (patch)
treefed94ab5b6b4b81a6ed669940ec25017fc330657
parent5b311c1519c658bf06f7a08a2ddc2648e4c9cd5c (diff)
mmc: sdhci: Fix to handle MMC_POWER_UNDEFINED
Since commit c2c24819b280 ("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: c2c24819b280 ("mmc: core: Don't power off the card when starting the host") Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/mmc/host/sdhci.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 111991e5b9a0..23909804ffb8 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1576,6 +1576,9 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
1576 unsigned long flags; 1576 unsigned long flags;
1577 u8 ctrl; 1577 u8 ctrl;
1578 1578
1579 if (ios->power_mode == MMC_POWER_UNDEFINED)
1580 return;
1581
1579 spin_lock_irqsave(&host->lock, flags); 1582 spin_lock_irqsave(&host->lock, flags);
1580 1583
1581 if (host->flags & SDHCI_DEVICE_DEAD) { 1584 if (host->flags & SDHCI_DEVICE_DEAD) {
@@ -2938,22 +2941,24 @@ int sdhci_runtime_resume_host(struct sdhci_host *host)
2938 2941
2939 sdhci_init(host, 0); 2942 sdhci_init(host, 0);
2940 2943
2941 /* Force clock and power re-program */ 2944 if (mmc->ios.power_mode != MMC_POWER_UNDEFINED) {
2942 host->pwr = 0; 2945 /* Force clock and power re-program */
2943 host->clock = 0; 2946 host->pwr = 0;
2944 mmc->ops->start_signal_voltage_switch(mmc, &mmc->ios); 2947 host->clock = 0;
2945 mmc->ops->set_ios(mmc, &mmc->ios); 2948 mmc->ops->start_signal_voltage_switch(mmc, &mmc->ios);
2949 mmc->ops->set_ios(mmc, &mmc->ios);
2946 2950
2947 if ((host_flags & SDHCI_PV_ENABLED) && 2951 if ((host_flags & SDHCI_PV_ENABLED) &&
2948 !(host->quirks2 & SDHCI_QUIRK2_PRESET_VALUE_BROKEN)) { 2952 !(host->quirks2 & SDHCI_QUIRK2_PRESET_VALUE_BROKEN)) {
2949 spin_lock_irqsave(&host->lock, flags); 2953 spin_lock_irqsave(&host->lock, flags);
2950 sdhci_enable_preset_value(host, true); 2954 sdhci_enable_preset_value(host, true);
2951 spin_unlock_irqrestore(&host->lock, flags); 2955 spin_unlock_irqrestore(&host->lock, flags);
2952 } 2956 }
2953 2957
2954 if ((mmc->caps2 & MMC_CAP2_HS400_ES) && 2958 if ((mmc->caps2 & MMC_CAP2_HS400_ES) &&
2955 mmc->ops->hs400_enhanced_strobe) 2959 mmc->ops->hs400_enhanced_strobe)
2956 mmc->ops->hs400_enhanced_strobe(mmc, &mmc->ios); 2960 mmc->ops->hs400_enhanced_strobe(mmc, &mmc->ios);
2961 }
2957 2962
2958 spin_lock_irqsave(&host->lock, flags); 2963 spin_lock_irqsave(&host->lock, flags);
2959 2964