Re: [PATCH] mmc: block: add reset workaround for partition switch failures
From: Linus Walleij
Date: Fri Feb 28 2025 - 03:06:27 EST
On Mon, Feb 24, 2025 at 6:00 AM Guan Wang <guan.wang.jy@xxxxxxxxx> wrote:
> Some eMMC devices (e.g., BGSD4R and AIM20F) may enter an unresponsive state
> after encountering CRC errors during RPMB writes (CMD25). This prevents the
> device from switching back to the main partition via CMD6, blocking further
> I/O operations.
>
> The root cause is suspected to be a firmware/hardware issue in specific
> eMMC models. A workaround is to perform a hardware reset via mmc_hw_reset()
> when the partition switch fails, followed by a retry.
>
> Add a workaround that:
> 1. If initial partition switch fails after rpmb access
> 2. Performs mmc card reset using mmc_hw_reset()
> 3. Retries switching to main partition
> This helps resolve cases where the device becomes unresponsive after
> RPMB operations.
>
> Signed-off-by: Guan Wang <guan.wang.jy@xxxxxxxxxxx>
This looks like a reasonable recovery to me.
However not all hosts support HW reset. You currently have to do
something this:
if ((host->caps & MMC_CAP_HW_RESET) &&
host->ops->card_hw_reset)
mmc_hw_reset(card);
Perhaps we should first just move this check into
mmc_hw_reset() so that function can be called unconditionally?
Yours,
Linus Walleij