mmc: sti_sdhci: Fix sdhci_setup_cfg() call.
authorPatrice Chotard <patrice.chotard@st.com>
Wed, 24 Jul 2019 07:51:02 +0000 (09:51 +0200)
committerPatrice Chotard <patrice.chotard@st.com>
Tue, 27 Aug 2019 07:36:56 +0000 (09:36 +0200)
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>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
drivers/mmc/sti_sdhci.c

index 8ed47e113db3c4bd18d524ae198c79c962ff5292..d6c75ea60105baab9e2e27ed5c89a74a448fc454 100644 (file)
@@ -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);