Skip to contentSkip to conversation

mmc: omap_hsmmc: Add small delay after enabling power

PATCH In review Stefan Roese 2 participants 3 messages Sep 11, 2014 – Sep 12, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: omap_hsmmc: Add small delay after enabling power

From: Thorsten Einsbein <[email protected]>

On the TAO3530 (OMAP3530 based) we noticed that some SD cards are not detected reliably upon bootup (timeout). Especially the SanDisk Ultra 8GiB seems to be problematic here. The SanDisk Extreme also has this problem on this platform, but not that often. A Samsung 8 GiB type 6 doesn't show this problem at all.

This patch now adds a short delay after enabling the power on the slot. With this delay all cards are detected reliably.

---
 drivers/mmc/host/omap_hsmmc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/host/omap_hsmmc.c +4 -0
index 9656726..62ff0a7 100644
@@ -335,6 +335,10 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on,
 				ret = mmc_regulator_set_ocr(host->mmc,
 							host->vcc, 0);
 		}
+
+		dev_dbg(host->dev, "omap_hsmmc_set_power: wait a little (slot %d)\n",
+			slot);
+		msleep(5);
 	} else {
 		/* Shut down the rail */
 		if (host->vcc_aux)
Signature · 1 line
2.1.0
#1 lore raw
Quoted 10 lines · Stefan Roese

From: Thorsten Einsbein <[email protected]>

On the TAO3530 (OMAP3530 based) we noticed that some SD cards are not detected reliably upon bootup (timeout). Especially the SanDisk Ultra 8GiB seems to be problematic here. The SanDisk Extreme also has this problem on this platform, but not that often. A Samsung 8 GiB type 6 doesn't show this problem at all.

This patch now adds a short delay after enabling the power on the slot. With this delay all cards are detected reliably.

Is this delay related to regulator ramp up/down time? Then I think it maybe should be a part of the regulator code/DT.

Kind regards
Uffe

Quoted 27 lines
---
 drivers/mmc/host/omap_hsmmc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mmc/host/omap_hsmmc.c +4 -1
index 9656726..62ff0a7 100644
@@ -335,6 +335,10 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on,
                                ret = mmc_regulator_set_ocr(host->mmc,
                                                        host->vcc, 0);
                }
+
+               dev_dbg(host->dev, "omap_hsmmc_set_power: wait a little (slot %d)\n",
+                       slot);
+               msleep(5);
        } else {
                /* Shut down the rail */
                if (host->vcc_aux)
--

2.1.0

#2 lore raw
Quoted 9 lines · Ulf Hansson
Quoted 8 lines · Stefan Roese

From: Thorsten Einsbein <[email protected]>

On the TAO3530 (OMAP3530 based) we noticed that some SD cards are not detected reliably upon bootup (timeout). Especially the SanDisk Ultra 8GiB seems to be problematic here. The SanDisk Extreme also has this problem on this platform, but not that often. A Samsung 8 GiB type 6 doesn't show this problem at all.

Quoted 5 lines
Quoted 2 lines

This patch now adds a short delay after enabling the power on the slot. With this delay all cards are detected reliably.

Is this delay related to regulator ramp up/down time? Then I think it maybe should be a part of the regulator code/DT.

Thanks for this feedback. Yes, adding "regulator-enable-ramp-delay" to the regulator(s) solves this issue too. I wasn't aware of that one.

The patch can be dropped.

Thanks,
Stefan