[Linux-stm32] [PATCH 1/3] mmc: mmci: do not count a data CRC error as a complete transfer
Linus Walleij
linusw at kernel.org
Thu Nov 5 09:25:21 CET 2026
On Sat, Oct 31, 2026 at 1:07 PM Mateusz Nowicki
<mateusz.nowicki at posteo.net> wrote:
> With datacnt_useless (STM32 variants) success is 0 on a data error and
> a CRC error subtracts one from it. bytes_xfered becomes 0xfffffe00 and
> mmc_blk completes the whole request as successful, although the
> controller stopped at the failing block. Reads return stale data and
> writes are lost without any error.
>
> Tested on the STM32MP257F-DK eMMC in HS200 with a forced bad tuning:
> without this change 5 of 14 reads returned zeros, with it all 10 reads
> were correct.
>
> Fixes: b79220b3e0af ("mmc: mmci: add variant property to not read datacnt")
> Cc: stable at vger.kernel.org
> Signed-off-by: Mateusz Nowicki <mateusz.nowicki at posteo.net>
Looks right but we really managed to make this code hard to
read, we should think about readability improvements.
Reviewed-by: Linus Walleij <linusw at kernel.org>
Yours,
Linus Walleij
More information about the Linux-stm32
mailing list