All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: fsl_esdhc_imx: Fix clock disable issue
@ 2021-08-17  9:09 ` Ye Li
  2021-08-25 21:47   ` Jaehoon Chung
  2021-10-07 14:13   ` sbabic
  0 siblings, 2 replies; 3+ messages in thread
From: Ye Li @ 2021-08-17  9:09 UTC (permalink / raw)
  To: jh80.chung, u-boot, peng.fan; +Cc: uboot-imx, haibo.chen

The SD clock disable is wrapped by MMC_SUPPORTS_TUNING. So it
only works when UHS is enabled. However, in SD initialization the
power cycle does not depends on UHS. But the power cycle needs
disable the SD clock before power down.
So this causes a problem when UHS is not enabled. Some cards can't
become ready (ACMD14 timeout) due to the clock is enabled during
power cycle.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
---
 drivers/mmc/fsl_esdhc_imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
index aabf395..7b67972 100644
--- a/drivers/mmc/fsl_esdhc_imx.c
+++ b/drivers/mmc/fsl_esdhc_imx.c
@@ -971,7 +971,6 @@ static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, struct mmc *mmc)
 	if (priv->clock != clock)
 		set_sysctl(priv, mmc, clock);
 
-#ifdef MMC_SUPPORTS_TUNING
 	if (mmc->clk_disable) {
 #ifdef CONFIG_FSL_USDHC
 		esdhc_clrbits32(&regs->vendorspec, VENDORSPEC_CKEN);
@@ -987,6 +986,7 @@ static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, struct mmc *mmc)
 #endif
 	}
 
+#ifdef MMC_SUPPORTS_TUNING
 	/*
 	 * For HS400/HS400ES mode, make sure set the strobe dll in the
 	 * target clock rate. So call esdhc_set_strobe_dll() after the
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: fsl_esdhc_imx: Fix clock disable issue
  2021-08-17  9:09 ` [PATCH] mmc: fsl_esdhc_imx: Fix clock disable issue Ye Li
@ 2021-08-25 21:47   ` Jaehoon Chung
  2021-10-07 14:13   ` sbabic
  1 sibling, 0 replies; 3+ messages in thread
From: Jaehoon Chung @ 2021-08-25 21:47 UTC (permalink / raw)
  To: Ye Li, u-boot, peng.fan; +Cc: uboot-imx, haibo.chen

On 8/17/21 6:09 PM, Ye Li wrote:
> The SD clock disable is wrapped by MMC_SUPPORTS_TUNING. So it
> only works when UHS is enabled. However, in SD initialization the
> power cycle does not depends on UHS. But the power cycle needs
> disable the SD clock before power down.
> So this causes a problem when UHS is not enabled. Some cards can't
> become ready (ACMD14 timeout) due to the clock is enabled during
> power cycle.
> 
> Signed-off-by: Ye Li <ye.li@nxp.com>
> Reviewed-by: Haibo Chen <haibo.chen@nxp.com>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/fsl_esdhc_imx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
> index aabf395..7b67972 100644
> --- a/drivers/mmc/fsl_esdhc_imx.c
> +++ b/drivers/mmc/fsl_esdhc_imx.c
> @@ -971,7 +971,6 @@ static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, struct mmc *mmc)
>  	if (priv->clock != clock)
>  		set_sysctl(priv, mmc, clock);
>  
> -#ifdef MMC_SUPPORTS_TUNING
>  	if (mmc->clk_disable) {
>  #ifdef CONFIG_FSL_USDHC
>  		esdhc_clrbits32(&regs->vendorspec, VENDORSPEC_CKEN);
> @@ -987,6 +986,7 @@ static int esdhc_set_ios_common(struct fsl_esdhc_priv *priv, struct mmc *mmc)
>  #endif
>  	}
>  
> +#ifdef MMC_SUPPORTS_TUNING
>  	/*
>  	 * For HS400/HS400ES mode, make sure set the strobe dll in the
>  	 * target clock rate. So call esdhc_set_strobe_dll() after the
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] mmc: fsl_esdhc_imx: Fix clock disable issue
  2021-08-17  9:09 ` [PATCH] mmc: fsl_esdhc_imx: Fix clock disable issue Ye Li
  2021-08-25 21:47   ` Jaehoon Chung
@ 2021-10-07 14:13   ` sbabic
  1 sibling, 0 replies; 3+ messages in thread
From: sbabic @ 2021-10-07 14:13 UTC (permalink / raw)
  To: Ye Li, U-Boot

> The SD clock disable is wrapped by MMC_SUPPORTS_TUNING. So it
> only works when UHS is enabled. However, in SD initialization the
> power cycle does not depends on UHS. But the power cycle needs
> disable the SD clock before power down.
> So this causes a problem when UHS is not enabled. Some cards can't
> become ready (ACMD14 timeout) due to the clock is enabled during
> power cycle.
> Signed-off-by: Ye Li <ye.li@nxp.com>
> Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-07 14:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20210817090941epcas1p47d8150d91ff02356539c3c2feb23f74f@epcas1p4.samsung.com>
2021-08-17  9:09 ` [PATCH] mmc: fsl_esdhc_imx: Fix clock disable issue Ye Li
2021-08-25 21:47   ` Jaehoon Chung
2021-10-07 14:13   ` sbabic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.