]> git.baikalelectronics.ru Git - uboot.git/commit
mmc: erase: Use TRIM erase when available
authorLoic Poulain <loic.poulain@linaro.org>
Thu, 26 Jan 2023 09:24:18 +0000 (10:24 +0100)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 10 Apr 2023 03:17:24 +0000 (12:17 +0900)
commit586c5cd78dbfcb9bbf45c38d2d130a78c8f0ef9d
treeab1570d07f5f0c373400b57202f44ca1ed235a4c
parentfe96f779614141b107d72aef3595d1159aa36e9b
mmc: erase: Use TRIM erase when available

The default erase command applies on erase group unit, and
simply round down to erase group size. When the start block
is not aligned to erase group size (e.g. erasing partition)
it causes unwanted erasing of the previous blocks, part of
the same erase group (e.g. owned by other logical partition,
or by the partition table itself).

To prevent this issue, a simple solution is to use TRIM as
argument of the Erase command, which is usually supported
with eMMC > 4.0, and allow to apply erase operation to write
blocks instead of erase group

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/mmc/mmc_write.c