summaryrefslogtreecommitdiff
path: root/drivers/mmc/core
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2018-10-09 10:25:08 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2018-10-09 10:25:08 +0300
commita7d247f5fb3a8c95e70c726bc3f02d55ef6aaeea (patch)
tree240a3aed8a08e02ad5157312b412018522213b83 /drivers/mmc/core
parent46b723dd867d599420fb640c0eaf2a866ef721d4 (diff)
parent41591b38f5f8f78344954b68582b5f00e56ffe61 (diff)
downloadlinux-a7d247f5fb3a8c95e70c726bc3f02d55ef6aaeea.tar.xz
Merge branch 'fixes' into next
Diffstat (limited to 'drivers/mmc/core')
-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,
if (brq->data.blocks > 1) {
/*
+ * Some SD cards in SPI mode return a CRC error or even lock up
+ * completely when trying to read the last block using a
+ * multiblock read command.
+ */
+ if (mmc_host_is_spi(card->host) && (rq_data_dir(req) == READ) &&
+ (blk_rq_pos(req) + blk_rq_sectors(req) ==
+ get_capacity(md->disk)))
+ brq->data.blocks--;
+
+ /*
* After a read error, we redo the request one sector
* at a time in order to accurately determine which
* sectors can be read successfully.