mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mmc: host: sdhci: Fix the incorrect soft reset operation when runtime resuming
@ 2019-07-15 10:58 Baolin Wang
  2019-07-15 11:19 ` Adrian Hunter
  0 siblings, 1 reply; 5+ messages in thread
From: Baolin Wang @ 2019-07-15 10:58 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson
  Cc: zhang.lyra, orsonzhai, linus.walleij, baolin.wang,
	vincent.guittot, linux-mmc, linux-kernel

In sdhci_runtime_resume_host() function, we will always do software reset
for all, but according to the specification, we should issue reset command
and reinitialize the SD/eMMC card. However, we only do reinitialize the
SD/eMMC card when the SD/eMMC card are power down during runtime suspend.

Thus for those platforms that do not power down the SD/eMMC card during
runtime suspend, we should not do software reset for all. To fix this
issue, we can add one condition to validate the MMC_CAP_AGGRESSIVE_PM
to decide if we can do software reset for all or just reset command
and data lines.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
 drivers/mmc/host/sdhci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 9715834..470c5e0 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -3333,7 +3333,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host)
 			host->ops->enable_dma(host);
 	}
 
-	sdhci_init(host, 0);
+	sdhci_init(host, !(mmc->caps & MMC_CAP_AGGRESSIVE_PM));
 
 	if (mmc->ios.power_mode != MMC_POWER_UNDEFINED &&
 	    mmc->ios.power_mode != MMC_POWER_OFF) {
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-07-16  5:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15 10:58 [PATCH] mmc: host: sdhci: Fix the incorrect soft reset operation when runtime resuming Baolin Wang
2019-07-15 11:19 ` Adrian Hunter
2019-07-15 11:37   ` Baolin Wang
2019-07-15 12:37     ` Adrian Hunter
2019-07-16  5:37       ` Baolin Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®