]> 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>
Tue, 5 May 2026 10:02:50 +0000 (06:02 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 May 2026 13:31:19 +0000 (15:31 +0200)
commit4e2beac059173998dec79f38e3e2d186ebd796ee
tree8674481de2049f2657f5ded94e3610d24a9ecd96
parentef48d871511f1d64766e36cb2cfbdbc9f3e17cdd
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>
drivers/mmc/core/card.h
drivers/mmc/core/queue.c
drivers/mmc/core/quirks.h
include/linux/mmc/card.h