public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] mmc: sti_sdhci: Fix sdhci_setup_cfg() call.
@ 2019-07-24  7:51 Patrice Chotard
  2019-07-24  9:12 ` [U-Boot] [PATCH v2] mmc: sti_sdhci: Fix sdhci_setup_cfg() call.【请注意,邮件由u-boot-bounces@lists.denx.de代发】 Kever Yang
  2019-08-26 13:48 ` [U-Boot] [PATCH v2] mmc: sti_sdhci: Fix sdhci_setup_cfg() call Patrice CHOTARD
  0 siblings, 2 replies; 3+ messages in thread
From: Patrice Chotard @ 2019-07-24  7:51 UTC (permalink / raw)
  To: u-boot

host->mmc, host->mmc->dev and host->mmc->priv must be set
before calling sdhci_setup_cfg() to avoid hang during mmc
initialization.

Thanks to commit 3d296365e4e8
("mmc: sdhci: Add support for sdhci-caps-mask") which put
this issue into evidence.

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
---

Changes in v2:
  - move host->mmc->priv initialization before sdhci_setup_cfg() call

 drivers/mmc/sti_sdhci.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/sti_sdhci.c b/drivers/mmc/sti_sdhci.c
index 8ed47e113d..d6c75ea601 100644
--- a/drivers/mmc/sti_sdhci.c
+++ b/drivers/mmc/sti_sdhci.c
@@ -97,14 +97,14 @@ static int sti_sdhci_probe(struct udevice *dev)
 		       SDHCI_QUIRK_NO_HISPD_BIT;
 
 	host->host_caps = MMC_MODE_DDR_52MHz;
+	host->mmc = &plat->mmc;
+	host->mmc->dev = dev;
+	host->mmc->priv = host;
 
 	ret = sdhci_setup_cfg(&plat->cfg, host, 50000000, 400000);
 	if (ret)
 		return ret;
 
-	host->mmc = &plat->mmc;
-	host->mmc->priv = host;
-	host->mmc->dev = dev;
 	upriv->mmc = host->mmc;
 
 	return sdhci_probe(dev);
-- 
2.17.1

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

* [U-Boot] [PATCH v2] mmc: sti_sdhci: Fix sdhci_setup_cfg() call.【请注意,邮件由u-boot-bounces@lists.denx.de代发】
  2019-07-24  7:51 [U-Boot] [PATCH v2] mmc: sti_sdhci: Fix sdhci_setup_cfg() call Patrice Chotard
@ 2019-07-24  9:12 ` Kever Yang
  2019-08-26 13:48 ` [U-Boot] [PATCH v2] mmc: sti_sdhci: Fix sdhci_setup_cfg() call Patrice CHOTARD
  1 sibling, 0 replies; 3+ messages in thread
From: Kever Yang @ 2019-07-24  9:12 UTC (permalink / raw)
  To: u-boot


On 2019/7/24 下午3:51, Patrice Chotard wrote:
> host->mmc, host->mmc->dev and host->mmc->priv must be set
> before calling sdhci_setup_cfg() to avoid hang during mmc
> initialization.
>
> Thanks to commit 3d296365e4e8
> ("mmc: sdhci: Add support for sdhci-caps-mask") which put
> this issue into evidence.
>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> ---
>
> Changes in v2:
>    - move host->mmc->priv initialization before sdhci_setup_cfg() call
>
>   drivers/mmc/sti_sdhci.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/sti_sdhci.c b/drivers/mmc/sti_sdhci.c
> index 8ed47e113d..d6c75ea601 100644
> --- a/drivers/mmc/sti_sdhci.c
> +++ b/drivers/mmc/sti_sdhci.c
> @@ -97,14 +97,14 @@ static int sti_sdhci_probe(struct udevice *dev)
>   		       SDHCI_QUIRK_NO_HISPD_BIT;
>   
>   	host->host_caps = MMC_MODE_DDR_52MHz;
> +	host->mmc = &plat->mmc;
> +	host->mmc->dev = dev;
> +	host->mmc->priv = host;
>   
>   	ret = sdhci_setup_cfg(&plat->cfg, host, 50000000, 400000);
>   	if (ret)
>   		return ret;
>   
> -	host->mmc = &plat->mmc;
> -	host->mmc->priv = host;
> -	host->mmc->dev = dev;
>   	upriv->mmc = host->mmc;


Same issue like rockchip_sdhci.c.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>

Thanks,
- Kever
>   
>   	return sdhci_probe(dev);

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

* [U-Boot] [PATCH v2] mmc: sti_sdhci: Fix sdhci_setup_cfg() call.
  2019-07-24  7:51 [U-Boot] [PATCH v2] mmc: sti_sdhci: Fix sdhci_setup_cfg() call Patrice Chotard
  2019-07-24  9:12 ` [U-Boot] [PATCH v2] mmc: sti_sdhci: Fix sdhci_setup_cfg() call.【请注意,邮件由u-boot-bounces@lists.denx.de代发】 Kever Yang
@ 2019-08-26 13:48 ` Patrice CHOTARD
  1 sibling, 0 replies; 3+ messages in thread
From: Patrice CHOTARD @ 2019-08-26 13:48 UTC (permalink / raw)
  To: u-boot


On 7/24/19 9:51 AM, Patrice Chotard wrote:
> host->mmc, host->mmc->dev and host->mmc->priv must be set
> before calling sdhci_setup_cfg() to avoid hang during mmc
> initialization.
>
> Thanks to commit 3d296365e4e8
> ("mmc: sdhci: Add support for sdhci-caps-mask") which put
> this issue into evidence.
>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> ---
>
> Changes in v2:
>   - move host->mmc->priv initialization before sdhci_setup_cfg() call
>
>  drivers/mmc/sti_sdhci.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/sti_sdhci.c b/drivers/mmc/sti_sdhci.c
> index 8ed47e113d..d6c75ea601 100644
> --- a/drivers/mmc/sti_sdhci.c
> +++ b/drivers/mmc/sti_sdhci.c
> @@ -97,14 +97,14 @@ static int sti_sdhci_probe(struct udevice *dev)
>  		       SDHCI_QUIRK_NO_HISPD_BIT;
>  
>  	host->host_caps = MMC_MODE_DDR_52MHz;
> +	host->mmc = &plat->mmc;
> +	host->mmc->dev = dev;
> +	host->mmc->priv = host;
>  
>  	ret = sdhci_setup_cfg(&plat->cfg, host, 50000000, 400000);
>  	if (ret)
>  		return ret;
>  
> -	host->mmc = &plat->mmc;
> -	host->mmc->priv = host;
> -	host->mmc->dev = dev;
>  	upriv->mmc = host->mmc;
>  
>  	return sdhci_probe(dev);


Applied on STM32 tree

Thanks

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

end of thread, other threads:[~2019-08-26 13:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-24  7:51 [U-Boot] [PATCH v2] mmc: sti_sdhci: Fix sdhci_setup_cfg() call Patrice Chotard
2019-07-24  9:12 ` [U-Boot] [PATCH v2] mmc: sti_sdhci: Fix sdhci_setup_cfg() call.【请注意,邮件由u-boot-bounces@lists.denx.de代发】 Kever Yang
2019-08-26 13:48 ` [U-Boot] [PATCH v2] mmc: sti_sdhci: Fix sdhci_setup_cfg() call Patrice CHOTARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox