mmc: block: Don't do single-sector reads during recovery
authorJonathan Bell <jonathan@raspberrypi.com>
Mon, 16 May 2022 09:28:27 +0000 (10:28 +0100)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Mon, 16 May 2022 14:35:24 +0000 (15:35 +0100)
commitdff79e31c3b05a50f725442c1fc19a6194491523
tree473cd2a7010a259a98c82ac050600ca9e374d688
parent652a3309cffc08c4f168e8042b6af7b8bacbd944
mmc: block: Don't do single-sector reads during recovery

See https://github.com/raspberrypi/linux/issues/5019

If an SD card has degraded performance such that IO operations time out
then the MMC block layer will leak SG DMA mappings in the swiotlb during
recovery. It retries the same SG and this causes the leak, as it is
mapped twice - once in sdhci_pre_req() and again during single-block
reads in sdhci_prepare_data().

Resetting the card (including power-cycling if a regulator for vmmc is
present) ought to be enough to recover a stuck state, so for now don't
try single-block reads in the recovery path.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
drivers/mmc/core/block.c