mmc: card: adding specific timeout to the sanitize request
since the sanitize request might take a long time, the timer should
be configured to a large timeout.
the timer is per-request timer. it is started when the request is being
issued, and incase the card is not responding or there is another issue
that might cause the SW to halt, the timer expires.
the timer becomes effective when issuing long-duration requests.
Change-Id: Ieca9b27cf08a03cba57e28f6e58151bec3b623dc
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 6ce7cbb..f917c98 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -59,6 +59,8 @@
#define INAND_CMD38_ARG_SECTRIM1 0x81
#define INAND_CMD38_ARG_SECTRIM2 0x88
+#define MMC_SANITIZE_REQ_TIMEOUT 240000 /* msec */
+
static DEFINE_MUTEX(block_mutex);
/*
@@ -871,7 +873,8 @@
mmc_hostname(card->host), __func__);
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
- EXT_CSD_SANITIZE_START, 1, 0);
+ EXT_CSD_SANITIZE_START, 1,
+ MMC_SANITIZE_REQ_TIMEOUT);
if (err)
pr_err("%s: %s - mmc_switch() with "