]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: CMD7 failing on ATP & Transcend MMC cards
authorJarkko Lavinen <jarkko.lavinen@nokia.com>
Mon, 3 Oct 2005 11:04:15 +0000 (14:04 +0300)
committerTony Lindgren <tony@atomide.com>
Mon, 3 Oct 2005 11:04:15 +0000 (14:04 +0300)
I see ATP and Transcend cards failing repeatedly in the card select command
(CMD7) due to illegal instruction after CMD2.  Doing an extra status inquiry
when leaving the card identification mode seems to fix this problem.
This bug occured when opening the mmc cover with mounted card inside and
closing the cover again. This will cause detection of any new cards in
the card detection mode and ATP and Transcend cards get confused.

I don't know why only ATP and Transcend have this problem and why
doing status inquiry helps.  Status inquiry command CMD13 is neutral
and is claimed to not chnage the card state in the MMC spec.
The order of commands must be CMD13 first, then CMD7.  CMD13 fails
also due to illegal instruction error after CMD2 but after this the
card is back to its senses.

If CMD7 is run first, and CMD13 once CMD7 is seen failing, this fails
to bring the card back to its senses.  Then the CMD7 fails repeatedly
due to command timeout before and after CMD13.

The attached patch does the extra probing in mmc_setup() during
low clock which is perhaps an overkill. One could do it also in
mmc_rescan() after switching back to higher clock.

drivers/mmc/mmc.c

index 62c0c175f6e0fbfdf8c1642e60efbbd3225c28e3..c2ecbea6daa403f45e2b39cd40ec142eef00d3cc 100644 (file)
@@ -1069,6 +1069,14 @@ static void mmc_setup(struct mmc_host *host)
        host->ios.bus_mode = MMC_BUSMODE_PUSHPULL;
        host->ops->set_ios(host, &host->ios);
 
+       /*
+        * Some already detectd cards get confused in the card identification
+        * mode and futher commands can fail.  Doing an extra status inquiry
+        * after the identification mode seems to get cards back to their
+        * senses.
+        */
+       mmc_check_cards(host);
+
        mmc_read_csds(host);
 
        if (host->mode == MMC_MODE_SD)