Skip to content

Commit

Permalink
mmc: avoid getting CID on SDIO-only cards
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Vrabel authored and Linus Torvalds committed Sep 10, 2010
1 parent 152831b commit f3c65b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/mmc/core/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,8 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
goto err;
}

err = mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid);

if (!err) {
if (ocr & R4_MEMORY_PRESENT
&& mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid) == 0) {
card->type = MMC_TYPE_SD_COMBO;

if (oldcard && (oldcard->type != MMC_TYPE_SD_COMBO ||
Expand Down
2 changes: 2 additions & 0 deletions include/linux/mmc/sdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
* [8:0] Byte/block count
*/

#define R4_MEMORY_PRESENT (1 << 27)

/*
SDIO status in R5
Type
Expand Down

0 comments on commit f3c65b2

Please sign in to comment.