1 From 0ed50abb2d8fc81570b53af25621dad560cd49b3 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Daniel=20Gl=C3=B6ckner?= <dg@emlix.com>
3 Date: Tue, 30 Aug 2016 14:17:30 +0200
4 Subject: mmc: block: don't use CMD23 with very old MMC cards
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 From: Daniel Glöckner <dg@emlix.com>
11 commit 0ed50abb2d8fc81570b53af25621dad560cd49b3 upstream.
13 CMD23 aka SET_BLOCK_COUNT was introduced with MMC v3.1.
14 Older versions of the specification allowed to terminate
15 multi-block transfers only with CMD12.
17 The patch fixes the following problem:
19 mmc0: new MMC card at address 0001
20 mmcblk0: mmc0:0001 SDMB-16 15.3 MiB
21 mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900
23 blk_update_request: I/O error, dev mmcblk0, sector 0
24 Buffer I/O error on dev mmcblk0, logical block 0, async page read
25 mmcblk0: unable to read partition table
27 Signed-off-by: Daniel Glöckner <dg@emlix.com>
28 Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
29 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
32 drivers/mmc/card/block.c | 3 ++-
33 1 file changed, 2 insertions(+), 1 deletion(-)
35 --- a/drivers/mmc/card/block.c
36 +++ b/drivers/mmc/card/block.c
37 @@ -2303,7 +2303,8 @@ again:
38 set_capacity(md->disk, size);
40 if (mmc_host_cmd23(card->host)) {
41 - if (mmc_card_mmc(card) ||
42 + if ((mmc_card_mmc(card) &&
43 + card->csd.mmca_vsn >= CSD_SPEC_VER_3) ||
45 card->scr.cmds & SD_SCR_CMD23_SUPPORT))
46 md->flags |= MMC_BLK_CMD23;