Commit f3c65b2870f2481f3646bc410a58a12989ecc704

Authored by David Vrabel
Committed by Linus Torvalds
1 parent 152831be91

mmc: avoid getting CID on SDIO-only cards

The introduction of support for SD combo cards breaks the initialization
of all CSR SDIO chips.  The GO_IDLE (CMD0) in mmc_sd_get_cid() causes CSR
chips to be reset (this is non-standard behavior).

When initializing an SDIO card check for a combo card by using the memory
present bit in the R4 response to IO_SEND_OP_COND (CMD5).  This avoids the
call to mmc_sd_get_cid() on an SDIO-only card.

Signed-off-by: David Vrabel <david.vrabel@csr.com>
Acked-by: Michal Mirolaw <mirq-linux@rere.qmqm.pl>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 2 changed files with 4 additions and 3 deletions Side-by-side Diff

drivers/mmc/core/sdio.c
... ... @@ -362,9 +362,8 @@
362 362 goto err;
363 363 }
364 364  
365   - err = mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid);
366   -
367   - if (!err) {
  365 + if (ocr & R4_MEMORY_PRESENT
  366 + && mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid) == 0) {
368 367 card->type = MMC_TYPE_SD_COMBO;
369 368  
370 369 if (oldcard && (oldcard->type != MMC_TYPE_SD_COMBO ||
include/linux/mmc/sdio.h
... ... @@ -38,6 +38,8 @@
38 38 * [8:0] Byte/block count
39 39 */
40 40  
  41 +#define R4_MEMORY_PRESENT (1 << 27)
  42 +
41 43 /*
42 44 SDIO status in R5
43 45 Type