[U-Boot] [PATCH] mmc: sdhci: increase default timeout and make it configurable

Masahiro Yamada yamada.masahiro at socionext.com
Thu Apr 28 08:09:10 CEST 2016


I found the current timeout is too short for some devices to execute
erase command.  Nor can we override CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT
from a board config.

Increase the default timeout and surround the define with "ifndef"
to allow to override it in case the default value is not a good fit.

Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
---

 drivers/mmc/sdhci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index ef7e615..7670d73 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -126,7 +126,9 @@ static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data,
 #ifndef CONFIG_SDHCI_CMD_MAX_TIMEOUT
 #define CONFIG_SDHCI_CMD_MAX_TIMEOUT		3200
 #endif
-#define CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT	100
+#ifndef CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT
+#define CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT	1000
+#endif
 
 static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
 		       struct mmc_data *data)
-- 
1.9.1



More information about the U-Boot mailing list