RE: [PATCH v1] mmc: sdhci-of-esdhc: fix the mmc error after sleep on ls1046ardb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It makes sense.

Acked-by: Yangbo Lu <yangbo.lu@xxxxxxx>

> -----Original Message-----
> From: yinbo.zhu@xxxxxxx [mailto:yinbo.zhu@xxxxxxx]
> Sent: 2017年11月28日 11:57
> To: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> Cc: Xiaobo Xie <xiaobo.xie@xxxxxxx>; Y.b. Lu <yangbo.lu@xxxxxxx>;
> linux-mmc@xxxxxxxxxxxxxxx; Yinbo Zhu <yinbo.zhu@xxxxxxx>
> Subject: [PATCH v1] mmc: sdhci-of-esdhc: fix the mmc error after sleep on
> ls1046ardb
> 
> From: "yinbo.zhu" <yinbo.zhu@xxxxxxx>
> 
> 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@xxxxxxx>
> ---
>  drivers/mmc/host/sdhci-of-esdhc.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-of-esdhc.c
> b/drivers/mmc/host/sdhci-of-esdhc.c
> index ac2505a95403..5ee0d86a2f4d 100644
> --- a/drivers/mmc/host/sdhci-of-esdhc.c
> +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> @@ -578,10 +578,18 @@ static void esdhc_clock_enable(struct sdhci_host
> *host, bool enable)
> 
>  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 @@
> -771,10 +779,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

��.n��������+%������w��{.n�����{��i��)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux