Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: sdhci-of-esdhc: fix the mmc error after sleep on ls1046ardb

When system wakes up from sleep on ls1046ardb, the SD operation fails
with mmc error messages since ESDHC_TB_EN bit couldn't be cleaned by
eSDHC_SYSCTL[RSTA]. It's proper to clean this bit in esdhc_reset()
rather than in probe.

Signed-off-by: yinbo.zhu <yinbo.zhu@nxp.com>
Acked-by: Yangbo Lu <yangbo.lu@nxp.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

yinbo.zhu and committed by
Ulf Hansson
f2bc6000 23a18525

+8 -4
+8 -4
drivers/mmc/host/sdhci-of-esdhc.c
··· 589 589 590 590 static void esdhc_reset(struct sdhci_host *host, u8 mask) 591 591 { 592 + u32 val; 593 + 592 594 sdhci_reset(host, mask); 593 595 594 596 sdhci_writel(host, host->ier, SDHCI_INT_ENABLE); 595 597 sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE); 598 + 599 + if (mask & SDHCI_RESET_ALL) { 600 + val = sdhci_readl(host, ESDHC_TBCTL); 601 + val &= ~ESDHC_TB_EN; 602 + sdhci_writel(host, val, ESDHC_TBCTL); 603 + } 596 604 } 597 605 598 606 /* The SCFG, Supplemental Configuration Unit, provides SoC specific ··· 792 784 793 785 pltfm_host = sdhci_priv(host); 794 786 esdhc = sdhci_pltfm_priv(pltfm_host); 795 - 796 - val = sdhci_readl(host, ESDHC_TBCTL); 797 - val &= ~ESDHC_TB_EN; 798 - sdhci_writel(host, val, ESDHC_TBCTL); 799 787 800 788 host_ver = sdhci_readw(host, SDHCI_HOST_VERSION); 801 789 esdhc->vendor_ver = (host_ver & SDHCI_VENDOR_VER_MASK) >>