Skip to content

Commit 463f0cc

Browse files
Wenchao Chensmb49
authored andcommitted
mmc: sdhci-sprd: Fix no reset data and command after voltage switch
BugLink: https://bugs.launchpad.net/bugs/2003896 commit dd30dcf upstream. After switching the voltage, no reset data and command will cause CMD2 timeout. Fixes: 29ca763 ("mmc: sdhci-sprd: Add pin control support for voltage switch") Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221130121328.25553-1-wenchao.chen@unisoc.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 901a6cf commit 463f0cc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/mmc/host/sdhci-sprd.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
431431
}
432432

433433
if (IS_ERR(sprd_host->pinctrl))
434-
return 0;
434+
goto reset;
435435

436436
switch (ios->signal_voltage) {
437437
case MMC_SIGNAL_VOLTAGE_180:
@@ -459,6 +459,8 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
459459

460460
/* Wait for 300 ~ 500 us for pin state stable */
461461
usleep_range(300, 500);
462+
463+
reset:
462464
sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
463465

464466
return 0;

0 commit comments

Comments
 (0)