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)
committerDom Cobley <popcornmix@gmail.com>
Tue, 23 Aug 2022 13:44:53 +0000 (14:44 +0100)
commite1f6a099431f0d01762969125d2829419b4309a6
tree40379ff38f279eb05d13c803f1a0da82dddb4848
parentffc21e58df1efb011e193399d686c8c2814ea4a4
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