Skip to contentSkip to conversation

mmc: fsl_esdhc: increase data transaction timeout to 500ms

PATCH New Yangbo Lu 2 participants 3 messages Dec 30, 2015 – Jan 27, 2016 MMC, SD and SDIO

lore
Share & tools
lore

Yangbo Lu

author
#0 lore raw

PATCH 1/1 mmc: fsl_esdhc: increase data transaction timeout to 500ms

The MMC spec says "It is strongly recommended for hosts to implement more than 500ms timeout value even if the card indicates the 250ms maximum busy length." Even the previous value of 300ms is known to be insufficient for some cards. So, increase the timeout to 500ms.

---
 drivers/mmc/fsl_esdhc.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/mmc/fsl_esdhc.c +8 -1
index c5054d6..12820cf 100644
@@ -252,8 +252,15 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)
 	 * Rounding up to next power of 2
 	 * => timeout + 13 = log2(mmc->clock/4) + 1
 	 * => timeout + 13 = fls(mmc->clock/4)
+	 *
+	 * However, the MMC spec "It is strongly recommended for hosts to
+	 * implement more than 500ms timeout value even if the card
+	 * indicates the 250ms maximum busy length."  Even the previous
+	 * value of 300ms is known to be insufficient for some cards.
+	 * So, we use
+	 * => timeout + 13 = fls(mmc->clock/2)
 	 */
-	timeout = fls(mmc->clock/4);
+	timeout = fls(mmc->clock/2);
 	timeout -= 13;
 
 	if (timeout > 14)
Signature · 1 line
2.1.0.27.g96db324
#1 lore raw

PATCH 1/1 mmc: fsl_esdhc: increase data transaction timeout to 500ms

Quoted 22 lines · Yangbo Lu

The MMC spec says "It is strongly recommended for hosts to implement more than 500ms timeout value even if the card indicates the 250ms maximum busy length." Even the previous value of 300ms is known to be insufficient for some cards. So, increase the timeout to 500ms.

---
 drivers/mmc/fsl_esdhc.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/mmc/fsl_esdhc.c +3 -0
index c5054d6..12820cf 100644
@@ -252,8 +252,15 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data)
 	 * Rounding up to next power of 2
 	 * => timeout + 13 = log2(mmc->clock/4) + 1
 	 * => timeout + 13 = fls(mmc->clock/4)
+	 *
+	 * However, the MMC spec "It is strongly recommended for hosts to
+	 * implement more than 500ms timeout value even if the card

drivers/mmc/fsl_esdhc.c static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data) · line 266

Quoted 10 lines
drivers/mmc/fsl_esdhc.c +5 -1
+	 * indicates the 250ms maximum busy length."  Even the previous
+	 * value of 300ms is known to be insufficient for some cards.
+	 * So, we use
+	 * => timeout + 13 = fls(mmc->clock/2)
 	 */
-	timeout = fls(mmc->clock/4);
+	timeout = fls(mmc->clock/2);
 	timeout -= 13;
 
 	if (timeout > 14)

Pantelis,

With your ack, I can take this in, unless you want to merge it.

York

#2 lore raw

PATCH 1/1 mmc: fsl_esdhc: increase data transaction timeout to 500ms

In reply to Yangbo Lu
Quoted 10 lines · Yangbo Lu

The MMC spec says "It is strongly recommended for hosts to implement more than 500ms timeout value even if the card indicates the 250ms maximum busy length." Even the previous value of 300ms is known to be insufficient for some cards. So, increase the timeout to 500ms.

---
 drivers/mmc/fsl_esdhc.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Applied to u-boot-fsl-qoriq master. Awaiting upstream.

Thanks.

York