Commit ad9be7ff authored by Avri Altman's avatar Avri Altman Committed by Ulf Hansson

mmc: core: Add sd discard timeout

The busy timeout is 250msec per discard command.
Signed-off-by: default avatarAvri Altman <avri.altman@wdc.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent bc47e2f6
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
/* The max erase timeout, used when host->max_busy_timeout isn't specified */ /* The max erase timeout, used when host->max_busy_timeout isn't specified */
#define MMC_ERASE_TIMEOUT_MS (60 * 1000) /* 60 s */ #define MMC_ERASE_TIMEOUT_MS (60 * 1000) /* 60 s */
#define SD_DISCARD_TIMEOUT_MS (250)
static const unsigned freqs[] = { 400000, 300000, 200000, 100000 }; static const unsigned freqs[] = { 400000, 300000, 200000, 100000 };
...@@ -1619,6 +1620,12 @@ static unsigned int mmc_sd_erase_timeout(struct mmc_card *card, ...@@ -1619,6 +1620,12 @@ static unsigned int mmc_sd_erase_timeout(struct mmc_card *card,
{ {
unsigned int erase_timeout; unsigned int erase_timeout;
/* for DISCARD none of the below calculation applies.
* the busy timeout is 250msec per discard command.
*/
if (arg == SD_DISCARD_ARG)
return SD_DISCARD_TIMEOUT_MS;
if (card->ssr.erase_timeout) { if (card->ssr.erase_timeout) {
/* Erase timeout specified in SD Status Register (SSR) */ /* Erase timeout specified in SD Status Register (SSR) */
erase_timeout = card->ssr.erase_timeout * qty + erase_timeout = card->ssr.erase_timeout * qty +
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment