Skip to content

Commit

Permalink
mmc: block: Don't do single-sector reads during recovery
Browse files Browse the repository at this point in the history
See #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 <[email protected]>
  • Loading branch information
P33M authored and popcornmix committed Sep 16, 2024
1 parent ffae29a commit 3e7100f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/core/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -1949,7 +1949,7 @@ static void mmc_blk_mq_rw_recovery(struct mmc_queue *mq, struct request *req)
return;
}

if (rq_data_dir(req) == READ && brq->data.blocks >
if (0 && rq_data_dir(req) == READ && brq->data.blocks >
queue_physical_block_size(mq->queue) >> 9) {
/* Read one (native) sector at a time */
mmc_blk_read_single(mq, req);
Expand Down

0 comments on commit 3e7100f

Please sign in to comment.