mmc: sdhci: add signal voltage switch in sdhci_resume_host
PATCH v2 1/1 mmc: sdhci: add signal voltage switch in sdhci_resume_host
I met one suspend/resume issue with sdr104 capable sdio wifi card (with "keep-power-in-suspend" set in DT property):
After resuming from suspend to ram, the sdio wifi card stops working. Further debug shows that although ios shows the sdio card is at sdr104 mode, the voltage is still at 3V3. This is due to missing the calling of ->start_signal_voltage_switch() in sdhci_resume_host().
Fix this issue by adding ->start_signal_voltage_switch() in sdhci_resume_host(). This also matches what we do for sdhci_runtime_resume_host().
Then the question is: why this issue hasn't reported and fixed for so long time. IMHO, several reasons: Some host controllers just kick off the runtime resume for system resume, so they benefit from the well supported runtime pm code; Some platforms just use the old sdio wifi card which doesn't need signal voltage switch at all, the default voltage is 3v3 after resuming.
---
since v1:
- add Adrian's Acked-by
- add Fixes tag
drivers/mmc/host/sdhci.c | 1 + 1 file changed, 1 insertion(+)
drivers/mmc/host/sdhci.c +1 -0
@@ -3836,6 +3836,7 @@ int sdhci_resume_host(struct sdhci_host *host) host->pwr =0 ; host->clock =0 ; host->reinit_uhs = true; + mmc->ops->start_signal_voltage_switch (mmc, &mmc->ios); mmc->ops->set_ios (mmc, &mmc->ios); }else {sdhci_init (host, (mmc->pm_flags &MMC_PM_KEEP_POWER ));
Signature · 1 line
2.53.0
Quoted 19 lines · Jisheng Zhang
I met one suspend/resume issue with sdr104 capable sdio wifi card (with "keep-power-in-suspend" set in DT property):
After resuming from suspend to ram, the sdio wifi card stops working. Further debug shows that although ios shows the sdio card is at sdr104 mode, the voltage is still at 3V3. This is due to missing the calling of ->start_signal_voltage_switch() insdhci_resume_host().Fix this issue by adding ->start_signal_voltage_switch() in
sdhci_resume_host(). This also matches what we do forsdhci_runtime_resume_host().Then the question is: why this issue hasn't reported and fixed for so long time. IMHO, several reasons: Some host controllers just kick off the runtime resume for system resume, so they benefit from the well supported runtime pm code; Some platforms just use the old sdio wifi card which doesn't need signal voltage switch at all, the default voltage is 3v3 after resuming.
Quoted 3 lines
Fixes 6308d2905bd3 ("mmc: sdhci: add quirk for keeping card power during suspend")Signed-off-by Jisheng Zhang <[email protected]>Acked-by Adrian Hunter <[email protected]>
Applied for fixes and by adding a stable tag, thanks!
Kind regards
Uffe
Quoted 23 lines
---
since v1:
- add Adrian's Acked-by
- add Fixes tagdrivers/mmc/host/sdhci.c | 1 + 1 file changed, 1 insertion(+)drivers/mmc/host/sdhci.c +1
-1@@ -3836,6 +3836,7 @@ int sdhci_resume_host(struct sdhci_host *host) host->pwr =0 ; host->clock =0 ; host->reinit_uhs = true; + mmc->ops->start_signal_voltage_switch (mmc, &mmc->ios); mmc->ops->set_ios (mmc, &mmc->ios); }else {sdhci_init (host, (mmc->pm_flags &MMC_PM_KEEP_POWER )); --2.53.0