blob: cfa2c6582ac6eea0cd393d581d2f187972b7fcb6 [file] [log] [blame]
From foo@baz Thu May 19 04:18:43 PM CEST 2022
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue, 17 May 2022 11:09:10 -0700
Subject: mmc: block: Use generic_cmd6_time when modifying INAND_CMD38_ARG_EXT_CSD
To: stable@vger.kernel.org
Cc: "Ulf Hansson" <ulf.hansson@linaro.org>, "Florian Fainelli" <f.fainelli@gmail.com>, "Adrian Hunter" <adrian.hunter@intel.com>, "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>, "Avri Altman" <avri.altman@wdc.com>, "Bean Huo" <beanhuo@micron.com>, "Nishad Kamdar" <nishadkamdar@gmail.com>, "Christian Löhle" <CLoehle@hyperstone.com>, linux-mmc@vger.kernel.org (open list:MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND...), linux-kernel@vger.kernel.org (open list), alcooperx@gmail.com, kdasu.kdev@gmail.com
Message-ID: <20220517180911.246016-3-f.fainelli@gmail.com>
From: Ulf Hansson <ulf.hansson@linaro.org>
commit ad91619aa9d78ab1c6d4a969c3db68bc331ae76c upstream
The INAND_CMD38_ARG_EXT_CSD is a vendor specific EXT_CSD register, which is
used to prepare an erase/trim operation. However, it doesn't make sense to
use a timeout of 10 minutes while updating the register, which becomes the
case when the timeout_ms argument for mmc_switch() is set to zero.
Instead, let's use the generic_cmd6_time, as that seems like a reasonable
timeout to use for these cases.
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20200122142747.5690-3-ulf.hansson@linaro.org
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/mmc/core/block.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -1126,7 +1126,7 @@ static void mmc_blk_issue_discard_rq(str
card->erase_arg == MMC_TRIM_ARG ?
INAND_CMD38_ARG_TRIM :
INAND_CMD38_ARG_ERASE,
- 0);
+ card->ext_csd.generic_cmd6_time);
}
if (!err)
err = mmc_erase(card, from, nr, card->erase_arg);
@@ -1168,7 +1168,7 @@ retry:
arg == MMC_SECURE_TRIM1_ARG ?
INAND_CMD38_ARG_SECTRIM1 :
INAND_CMD38_ARG_SECERASE,
- 0);
+ card->ext_csd.generic_cmd6_time);
if (err)
goto out_retry;
}
@@ -1186,7 +1186,7 @@ retry:
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
INAND_CMD38_ARG_EXT_CSD,
INAND_CMD38_ARG_SECTRIM2,
- 0);
+ card->ext_csd.generic_cmd6_time);
if (err)
goto out_retry;
}