diff options
author | Timo Teras <timo.teras@solidboot.com> | 2006-10-25 02:37:41 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2006-11-09 01:23:37 -0500 |
commit | 25a122fd0d28b48782b9524a85895573e7ccf304 (patch) | |
tree | 10a43451698a5ddd09b7c4bbd2accfd6efd33737 /drivers/mmc | |
parent | 088406bcf66d6c7fd8a5c04c00aa410ae9077403 (diff) |
MMC: Poll card status after rescanning cards
Some broken cards seem to process CMD1 even in stand-by state. The result is
that the card replies with ILLEGAL_COMMAND error for the next command sent
after rescanning. Currently the next command is select card, which would
return the error. But CMD7 does actually succeed and retries of the command
will timeout. The workaround is to poll card status after CMD1 to clear the
pending error.
Signed-off-by: Timo Teras <timo.teras@solidboot.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/mmc.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index ee8863c123e3..ec8168ac75b1 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c | |||
@@ -1178,14 +1178,29 @@ static void mmc_rescan(void *data) | |||
1178 | { | 1178 | { |
1179 | struct mmc_host *host = data; | 1179 | struct mmc_host *host = data; |
1180 | struct list_head *l, *n; | 1180 | struct list_head *l, *n; |
1181 | unsigned char power_mode; | ||
1181 | 1182 | ||
1182 | mmc_claim_host(host); | 1183 | mmc_claim_host(host); |
1183 | 1184 | ||
1184 | if (host->ios.power_mode == MMC_POWER_ON) | 1185 | /* |
1186 | * Check for removed cards and newly inserted ones. We check for | ||
1187 | * removed cards first so we can intelligently re-select the VDD. | ||
1188 | */ | ||
1189 | power_mode = host->ios.power_mode; | ||
1190 | if (power_mode == MMC_POWER_ON) | ||
1185 | mmc_check_cards(host); | 1191 | mmc_check_cards(host); |
1186 | 1192 | ||
1187 | mmc_setup(host); | 1193 | mmc_setup(host); |
1188 | 1194 | ||
1195 | /* | ||
1196 | * Some broken cards process CMD1 even in stand-by state. There is | ||
1197 | * no reply, but an ILLEGAL_COMMAND error is cached and returned | ||
1198 | * after next command. We poll for card status here to clear any | ||
1199 | * possibly pending error. | ||
1200 | */ | ||
1201 | if (power_mode == MMC_POWER_ON) | ||
1202 | mmc_check_cards(host); | ||
1203 | |||
1189 | if (!list_empty(&host->cards)) { | 1204 | if (!list_empty(&host->cards)) { |
1190 | /* | 1205 | /* |
1191 | * (Re-)calculate the fastest clock rate which the | 1206 | * (Re-)calculate the fastest clock rate which the |