@@ -1809,7 +1809,8 @@ static void mmc_blk_mq_rw_recovery(struct mmc_queue *mq, struct request *req)
/* FIXME: Missing single sector read for large sector size */
if (!mmc_large_sector(card) && rq_data_dir(req) == READ &&
- brq->data.blocks > 1) {
+ brq->data.blocks > 1 &&
+ !card->host->no_single_read_retry) {
/* Read one sector at a time */
mmc_blk_read_single(mq, req);
return;
@@ -352,6 +352,12 @@ int mmc_of_parse(struct mmc_host *host)
if (device_property_read_bool(dev, "no-mmc"))
host->caps2 |= MMC_CAP2_NO_MMC;
+ if (device_property_read_bool(dev, "no-single-read-retry")) {
+ dev_info(host->parent,
+ "Single block read retrying is not supported\n");
+ host->no_single_read_retry = true;
+ }
+
/* Must be after "non-removable" check */
if (device_property_read_u32(dev, "fixed-emmc-driver-type", &drv_type) == 0) {
if (host->caps & MMC_CAP_NONREMOVABLE)
@@ -502,6 +502,9 @@ struct mmc_host {
/* Host Software Queue support */
bool hsq_enabled;
+ /* Do not retry multi block read as single block read */
+ bool no_single_read_retry;
+
unsigned long private[] ____cacheline_aligned;
};
This makes to handle read errors faster by not retrying multiple block read(CMD18) errors with single block reads(CMD17). On some bad SD Cards that have problem with read operations, it is not helpful to retry multiple block read errors with several single block reads, and it is delayed to treat read operations as I/O error as much as retrying single block reads. Signed-off-by: DooHyun Hwang <dh0421.hwang@samsung.com> --- drivers/mmc/core/block.c | 3 ++- drivers/mmc/core/host.c | 6 ++++++ include/linux/mmc/host.h | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-)