mmc: mmc_test: use erase_arg for mmc_erase command
authorYann Gautier <yann.gautier@foss.st.com>
Tue, 9 Feb 2021 14:52:14 +0000 (15:52 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Fri, 12 Feb 2021 11:07:03 +0000 (12:07 +0100)
commit3f957dec6dc219a8a1bf6d7994ee95ed7004f701
tree154e7e6ee9c406113fc7e875f2770e187c5489d8
parent0c1a3e8b2e98e8e73453ff86c2ce727441005fb3
mmc: mmc_test: use erase_arg for mmc_erase command

Since [1], the erase argument for mmc_erase() function is saved in
erase_arg field of card structure. It is preferable to use it instead of
hard-coded MMC_SECURE_ERASE_ARG, which from eMMC 4.51 spec is not
recommended:
"6.6.16 Secure Erase
NOTE Secure Erase is included for backwards compatibility. New system
level implementations (based on v4.51 devices and beyond) should use
Erase combined with Sanitize instead of secure erase."

On STM32MP157C-EV1 board, embedding a THGBMDG5D1LBAIL eMMC, using
MMC_ERASE command with MMC_SECURE_ERASE_ARG may stuck the STM32 SDMMC IP,
if test 37 or test 38 are launched just after a write test, e.g. test 36.
Using the default MMC_ERASE argument from framework with erase_arg,
which default in our case to MMC_DISCARD_ARG does no more trig the
issue.

 [1] commit 01904ff77676 ("mmc: core: Calculate the discard arg only once")

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20210209145214.10518-1-yann.gautier@foss.st.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/mmc_test.c