aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/core/block.c')
-rw-r--r--drivers/mmc/core/block.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index a0b9102c4c6e..e201ccb3fda4 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -1371,6 +1371,16 @@ static void mmc_blk_data_prep(struct mmc_queue *mq, struct mmc_queue_req *mqrq,
1371 1371
1372 if (brq->data.blocks > 1) { 1372 if (brq->data.blocks > 1) {
1373 /* 1373 /*
1374 * Some SD cards in SPI mode return a CRC error or even lock up
1375 * completely when trying to read the last block using a
1376 * multiblock read command.
1377 */
1378 if (mmc_host_is_spi(card->host) && (rq_data_dir(req) == READ) &&
1379 (blk_rq_pos(req) + blk_rq_sectors(req) ==
1380 get_capacity(md->disk)))
1381 brq->data.blocks--;
1382
1383 /*
1374 * After a read error, we redo the request one sector 1384 * After a read error, we redo the request one sector
1375 * at a time in order to accurately determine which 1385 * at a time in order to accurately determine which
1376 * sectors can be read successfully. 1386 * sectors can be read successfully.