提交 83b25c17 编写于 作者: W Wenchao Chen 提交者: sanglipeng

mmc: sdhci-sprd: Fix no reset data and command after voltage switch

stable inclusion
from stable-v5.10.158
commit ed1966245307bad007b74068759d5af5aadf6b3f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7NTXH

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ed1966245307bad007b74068759d5af5aadf6b3f

--------------------------------

commit dd30dcfa upstream.

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

Fixes: 29ca763f ("mmc: sdhci-sprd: Add pin control support for voltage switch")
Signed-off-by: NWenchao Chen <wenchao.chen@unisoc.com>
Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
Reviewed-by: NBaolin Wang <baolin.wang@linux.alibaba.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20221130121328.25553-1-wenchao.chen@unisoc.comSigned-off-by: NUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
上级 ecb94f31
...@@ -457,7 +457,7 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -457,7 +457,7 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
} }
if (IS_ERR(sprd_host->pinctrl)) if (IS_ERR(sprd_host->pinctrl))
return 0; goto reset;
switch (ios->signal_voltage) { switch (ios->signal_voltage) {
case MMC_SIGNAL_VOLTAGE_180: case MMC_SIGNAL_VOLTAGE_180:
...@@ -485,6 +485,8 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -485,6 +485,8 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
/* Wait for 300 ~ 500 us for pin state stable */ /* Wait for 300 ~ 500 us for pin state stable */
usleep_range(300, 500); usleep_range(300, 500);
reset:
sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册