aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/core/mmc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 35873d4cc442..b81b08f81325 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -333,6 +333,9 @@ static void mmc_manage_gp_partitions(struct mmc_card *card, u8 *ext_csd)
333 } 333 }
334} 334}
335 335
336/* Minimum partition switch timeout in milliseconds */
337#define MMC_MIN_PART_SWITCH_TIME 300
338
336/* 339/*
337 * Decode extended CSD. 340 * Decode extended CSD.
338 */ 341 */
@@ -397,6 +400,10 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)
397 400
398 /* EXT_CSD value is in units of 10ms, but we store in ms */ 401 /* EXT_CSD value is in units of 10ms, but we store in ms */
399 card->ext_csd.part_time = 10 * ext_csd[EXT_CSD_PART_SWITCH_TIME]; 402 card->ext_csd.part_time = 10 * ext_csd[EXT_CSD_PART_SWITCH_TIME];
403 /* Some eMMC set the value too low so set a minimum */
404 if (card->ext_csd.part_time &&
405 card->ext_csd.part_time < MMC_MIN_PART_SWITCH_TIME)
406 card->ext_csd.part_time = MMC_MIN_PART_SWITCH_TIME;
400 407
401 /* Sleep / awake timeout in 100ns units */ 408 /* Sleep / awake timeout in 100ns units */
402 if (sa_shift > 0 && sa_shift <= 0x17) 409 if (sa_shift > 0 && sa_shift <= 0x17)