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 raspberrypi#5019

If an SD card has degraded performance such that IO operations time out
then the MMC block layer will leak SG DMA mappings 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 remove
the call to mmc_blk_read_single().

Signed-off-by: Jonathan Bell <[email protected]>
  • Loading branch information
P33M committed May 16, 2022
1 parent 1125a6a commit cd756c3
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions drivers/mmc/core/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -1869,14 +1869,6 @@ static void mmc_blk_mq_rw_recovery(struct mmc_queue *mq, struct request *req)
mqrq->retries = MMC_MAX_RETRIES - MMC_DATA_RETRIES;
return;
}

/* FIXME: Missing single sector read for large sector size */
if (!mmc_large_sector(card) && rq_data_dir(req) == READ &&
brq->data.blocks > 1) {
/* Read one sector at a time */
mmc_blk_read_single(mq, req);
return;
}
}

static inline bool mmc_blk_rq_error(struct mmc_blk_request *brq)
Expand Down

0 comments on commit cd756c3

Please sign in to comment.