aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorWolfgang Muees <wolfgang.mues@auerswald.de>2009-03-11 09:28:39 -0400
committerPierre Ossman <drzeus@drzeus.cx>2009-03-24 16:30:02 -0400
commitc0c88871574ccb4ee53dde1bbb678931b38ed47b (patch)
tree5b820a07f99534f36867bc7ae1b01e427dcf086a /drivers/mmc
parentea15ba5cd7bb370902cd9f6a73c2d288bfba6b2c (diff)
mmc_spi: allow higher timeouts for SPI mode
Some SD cards have very high timeouts in SPI mode. So adjust the timeouts from theory to practice. Signed-off-by: Wolfgang Muees <wolfgang.mues@auerswald.de> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/core.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 4a18d90556d9..5c83c67b186c 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -297,6 +297,21 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card)
297 data->timeout_clks = 0; 297 data->timeout_clks = 0;
298 } 298 }
299 } 299 }
300 /*
301 * Some cards need very high timeouts if driven in SPI mode.
302 * The worst observed timeout was 900ms after writing a
303 * continuous stream of data until the internal logic
304 * overflowed.
305 */
306 if (mmc_host_is_spi(card->host)) {
307 if (data->flags & MMC_DATA_WRITE) {
308 if (data->timeout_ns < 1000000000)
309 data->timeout_ns = 1000000000; /* 1s */
310 } else {
311 if (data->timeout_ns < 100000000)
312 data->timeout_ns = 100000000; /* 100ms */
313 }
314 }
300} 315}
301EXPORT_SYMBOL(mmc_set_data_timeout); 316EXPORT_SYMBOL(mmc_set_data_timeout);
302 317