mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-sprd: Fix no reset data and command after voltage switch
@ 2022-11-30  8:02 Wenchao Chen
  2022-11-30  9:58 ` Adrian Hunter
  2022-11-30 10:42 ` Baolin Wang
  0 siblings, 2 replies; 4+ messages in thread
From: Wenchao Chen @ 2022-11-30  8:02 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson, orsonzhai, baolin.wang, zhang.lyra
  Cc: linux-mmc, linux-kernel, zhenxiong.lai, yuelin.tang, gengcixi

After switching the voltage, no reset data and command will cause
CMD2 timeout.

Fixes: 29ca763fc26f ("mmc: sdhci-sprd: Add pin control support for voltage switch")
Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com>
---
 drivers/mmc/host/sdhci-sprd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
index b92a408f138d..464508be8ec8 100644
--- a/drivers/mmc/host/sdhci-sprd.c
+++ b/drivers/mmc/host/sdhci-sprd.c
@@ -470,7 +470,7 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
 	}
 
 	if (IS_ERR(sprd_host->pinctrl))
-		return 0;
+		goto reset;
 
 	switch (ios->signal_voltage) {
 	case MMC_SIGNAL_VOLTAGE_180:
@@ -496,6 +496,7 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
 		break;
 	}
 
+reset:
 	/* Wait for 300 ~ 500 us for pin state stable */
 	usleep_range(300, 500);
 	sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
-- 
2.17.1


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

end of thread, other threads:[~2022-11-30 11:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-30  8:02 [PATCH] mmc: sdhci-sprd: Fix no reset data and command after voltage switch Wenchao Chen
2022-11-30  9:58 ` Adrian Hunter
2022-11-30 10:42 ` Baolin Wang
2022-11-30 11:58   ` Wenchao Chen

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®