[PATCH v2] mmc: bcm2835: restore scatterlist after DMA setup failure
Stefan Wahren
wahrenst at gmx.net
Sun Nov 22 04:39:01 PST 2026
Am 22.11.26 um 08:58 schrieb Artem Novak:
> The DMA preparation path shortens the final scatterlist entry
> to reserve space for FIFO drain words.
>
> If DMA mapping or descriptor preparation fails, the request
> falls back to PIO, but the shortened scatterlist entry is left
> unchanged. As a result, the PIO transfer may omit part of the
> data, potentially causing corrupted or incomplete I/O.
>
> Restore the entry's original length and clear drain_words
> before returning to the fallback path.
>
> This issue was found while investigating a kernel panic on
> my Raspberry Pi server.
>
> Fixes: 660fc733bd74 ("mmc: bcm2835: Add new driver for the sdhost controller.")
> Signed-off-by: Artem Novak <artem122novak at gmail.com>
Reviewed-by: Stefan Wahren <wahrenst at gmx.net>
More information about the linux-arm-kernel
mailing list