summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLuke Wang <ziniu.wang_1@nxp.com>2026-05-05 13:17:31 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-05-14 16:30:25 +0300
commitafece4e3f2cd57bb4eef8c80ea02eeaa900063e2 (patch)
treeaff1b381af7ca53903bbb824d3e0098ef26d18db /include/linux
parentf597ab044bea75601ce00f694d3e12d1476c2d68 (diff)
downloadlinux-afece4e3f2cd57bb4eef8c80ea02eeaa900063e2.tar.xz
mmc: core: Optimize time for secure erase/trim for some Kingston eMMCs
[ Upstream commit d6bf2e64dec87322f2b11565ddb59c0e967f96e3 ] Kingston eMMC IY2964 and IB2932 takes a fixed ~2 seconds for each secure erase/trim operation regardless of size - that is, a single secure erase/trim operation of 1MB takes the same time as 1GB. With default calculated 3.5MB max discard size, secure erase 1GB requires ~300 separate operations taking ~10 minutes total. Add a card quirk, MMC_QUIRK_FIXED_SECURE_ERASE_TRIM_TIME, to set maximum secure erase size for those devices. This allows 1GB secure erase to complete in a single operation, reducing time from 10 minutes to just 2 seconds. Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com> Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mmc/card.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index fd0cb188c46e..8151f2240db4 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -331,6 +331,7 @@ struct mmc_card {
#define MMC_QUIRK_BROKEN_SD_POWEROFF_NOTIFY (1<<17) /* Disable broken SD poweroff notify support */
#define MMC_QUIRK_NO_UHS_DDR50_TUNING (1<<18) /* Disable DDR50 tuning */
#define MMC_QUIRK_BROKEN_MDT (1<<19) /* Wrong manufacturing year */
+#define MMC_QUIRK_FIXED_SECURE_ERASE_TRIM_TIME (1<<20) /* Secure erase/trim time is fixed regardless of size */
bool written_flag; /* Indicates eMMC has been written since power on */
bool reenable_cmdq; /* Re-enable Command Queue */