]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mmc: core: Optimize time for secure erase/trim for some Kingston eMMCs
authorLuke Wang <ziniu.wang_1@nxp.com>
Wed, 4 Feb 2026 03:40:03 +0000 (11:40 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 23 Feb 2026 11:06:55 +0000 (12:06 +0100)
commitd6bf2e64dec87322f2b11565ddb59c0e967f96e3
treebb217f47501b129c9f4a5de5feedc4937ca8623f
parentf3b9683bf5432aaada84bb4a7f815f3eb3148a90
mmc: core: Optimize time for secure erase/trim for some Kingston eMMCs

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>
drivers/mmc/core/card.h
drivers/mmc/core/queue.c
drivers/mmc/core/quirks.h
include/linux/mmc/card.h