Skip to contentSkip to conversation

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

PATCH Ulf Hansson 2 participants 2 messages Dec 5, 2017 – Dec 6, 2017 1 message not in the archive MMC, SD and SDIO

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Ulf Hansson

author Applied
#1 lore raw
Quoted 10 lines · Yangbo Lu

From: "yinbo.zhu" <[email protected]>

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.

Thanks, applied for next.

I don't know why you guys did send several version on top, the only change I could find was the acked-by tag. Right?

Kind regards
Uffe

Quoted 44 lines

---
Changes for v2:
- Added Acked-by of Yangbo and Adrian.

---
 drivers/mmc/host/sdhci-of-esdhc.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/mmc/host/sdhci-of-esdhc.c +8 -5
index d74030f3bd12..4ffa6b173a21 100644
@@ -589,10 +589,18 @@ static void esdhc_pltfm_set_bus_width(struct sdhci_host *host, int width)
 
 static void esdhc_reset(struct sdhci_host *host, u8 mask)
 {
+       u32 val;
+
        sdhci_reset(host, mask);
 
        sdhci_writel(host, host->ier, SDHCI_INT_ENABLE);
        sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE);
+
+       if (mask & SDHCI_RESET_ALL) {
+               val = sdhci_readl(host, ESDHC_TBCTL);
+               val &= ~ESDHC_TB_EN;
+               sdhci_writel(host, val, ESDHC_TBCTL);
+       }
 }
 
 /* The SCFG, Supplemental Configuration Unit, provides SoC specific
@@ -785,10 +793,6 @@ static void esdhc_init(struct platform_device *pdev, struct sdhci_host *host)
        pltfm_host = sdhci_priv(host);
        esdhc = sdhci_pltfm_priv(pltfm_host);
 
-       val = sdhci_readl(host, ESDHC_TBCTL);
-       val &= ~ESDHC_TB_EN;
-       sdhci_writel(host, val, ESDHC_TBCTL);
-
        host_ver = sdhci_readw(host, SDHCI_HOST_VERSION);
        esdhc->vendor_ver = (host_ver & SDHCI_VENDOR_VER_MASK) >>
                             SDHCI_VENDOR_VER_SHIFT;
--

2.14.1

#2 lore raw

Hi Uffe,

I'm sorry for the redundant emails from us.
Yinbo found his email couldn’t reach patchwork but didn’t know why this happened. So I helped him to resend one. Just got same problem.
Strange, we still don’t know the reason.

Thanks a lot.

Best regards,
Yangbo Lu

Quoted 75 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: 2017年12月6日 0:29
To: Y.b. Lu <[email protected]>
Cc: [email protected]; Adrian Hunter <[email protected]>; Yinbo Zhu <[email protected]>
Subject: Re: [v2] mmc: sdhci-of-esdhc: fix the mmc error after sleep on ls1046ardb

Quoted 10 lines · Yangbo Lu

From: "yinbo.zhu" <[email protected]>

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.

Thanks, applied for next.

I don't know why you guys did send several version on top, the only change I could find was the acked-by tag. Right?

Kind regards
Uffe

drivers/mmc/host/sdhci-of-esdhc.c static void esdhc_init(struct platform_device *pdev,

Quoted 32 lines

---
Changes for v2:
- Added Acked-by of Yangbo and Adrian.

---
 drivers/mmc/host/sdhci-of-esdhc.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/mmc/host/sdhci-of-esdhc.c +8 -0
index d74030f3bd12..4ffa6b173a21 100644
@@ -589,10 +589,18 @@ static void esdhc_pltfm_set_bus_width(struct
 sdhci_host *host, int width)
 
 static void esdhc_reset(struct sdhci_host *host, u8 mask)  {
+       u32 val;
+
        sdhci_reset(host, mask);
 
        sdhci_writel(host, host->ier, SDHCI_INT_ENABLE);
        sdhci_writel(host, host->ier, SDHCI_SIGNAL_ENABLE);
+
+       if (mask & SDHCI_RESET_ALL) {
+               val = sdhci_readl(host, ESDHC_TBCTL);
+               val &= ~ESDHC_TB_EN;
+               sdhci_writel(host, val, ESDHC_TBCTL);
+       }
 }
 
 /* The SCFG, Supplemental Configuration Unit, provides SoC specific
@@ -785,10 +793,6 @@ static void esdhc_init(struct platform_device *pdev,

struct sdhci_host *host)

Quoted 13 lines
drivers/mmc/host/sdhci-of-esdhc.c +0 -5
        pltfm_host = sdhci_priv(host);
        esdhc = sdhci_pltfm_priv(pltfm_host);
 
-       val = sdhci_readl(host, ESDHC_TBCTL);
-       val &= ~ESDHC_TB_EN;
-       sdhci_writel(host, val, ESDHC_TBCTL);
-
        host_ver = sdhci_readw(host, SDHCI_HOST_VERSION);
        esdhc->vendor_ver = (host_ver & SDHCI_VENDOR_VER_MASK) >>
                             SDHCI_VENDOR_VER_SHIFT;
--

2.14.1