From 5fb4ec6ff4ea58bdadaf7bc88ec8ff10636df98a Mon Sep 17 00:00:00 2001 From: Jarkko Lavinen Date: Mon, 3 Oct 2005 14:04:15 +0300 Subject: [PATCH] [PATCH] ARM: OMAP: CMD7 failing on ATP & Transcend MMC cards 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 62c0c175f6e..c2ecbea6daa 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -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) -- 2.41.1