aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/mmc_ops.c
diff options
context:
space:
mode:
authorBean Huo <beanhuo@micron.com>2021-04-02 11:24:31 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2021-04-12 08:50:44 +0200
commit4f111d04fb350e1d6930ee80ee700b6e43bdf6f7 (patch)
treefb955dd5170eb2420fd1417782467f2ebf03e9d7 /drivers/mmc/core/mmc_ops.c
parentmmc: sdhci-pci: Fix initialization of some SD cards for Intel BYT-based controllers (diff)
downloadlinux-dev-4f111d04fb350e1d6930ee80ee700b6e43bdf6f7.tar.xz
linux-dev-4f111d04fb350e1d6930ee80ee700b6e43bdf6f7.zip
mmc: core: Use userland specified timeout value for eMMC sanitize
As the density increases, the 4-minute timeout value for sanitize is no longer feasible. At the same time, devices of different densities have different timeout values, which makes it difficult to use a common timeout value. Therefore, let's pass down the userland-specified sanitize timeout value so it can be used. Signed-off-by: Bean Huo <beanhuo@micron.com> Link: https://lore.kernel.org/r/20210402092432.25069-2-huobean@gmail.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/mmc_ops.c')
-rw-r--r--drivers/mmc/core/mmc_ops.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index f413474f0f80..ccca067db993 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -1010,7 +1010,7 @@ int mmc_cmdq_disable(struct mmc_card *card)
}
EXPORT_SYMBOL_GPL(mmc_cmdq_disable);
-int mmc_sanitize(struct mmc_card *card)
+int mmc_sanitize(struct mmc_card *card, unsigned int timeout_ms)
{
struct mmc_host *host = card->host;
int err;
@@ -1020,12 +1020,15 @@ int mmc_sanitize(struct mmc_card *card)
return -EOPNOTSUPP;
}
+ if (!timeout_ms)
+ timeout_ms = MMC_SANITIZE_TIMEOUT_MS;
+
pr_debug("%s: Sanitize in progress...\n", mmc_hostname(host));
mmc_retune_hold(host);
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_SANITIZE_START,
- 1, MMC_SANITIZE_TIMEOUT_MS);
+ 1, timeout_ms);
if (err)
pr_err("%s: Sanitize failed err=%d\n", mmc_hostname(host), err);