diff options
author | ian <ian@FreeBSD.org> | 2015-07-18 16:56:51 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2015-07-18 16:56:51 +0000 |
commit | e54300aae26b28c5b178f1d44521f53a70a02365 (patch) | |
tree | e82ffd992125042ed2ebec5d10705cdc924bd425 /sys/dev/mmc | |
parent | b13eda26742b67ed36f8e9ca1c7e2ddddbe25bda (diff) | |
download | FreeBSD-src-e54300aae26b28c5b178f1d44521f53a70a02365.zip FreeBSD-src-e54300aae26b28c5b178f1d44521f53a70a02365.tar.gz |
Deselect the sd card before re-selecting it when working around a problem
with some cards that causes them to become deselected after probing for
switch capabilities. The old workaround fixes the behavior with some cards,
but causes problems with the cards the behave correctly and don't become
deselected. Forcing a deselect then reselect appears to work correctly
with all cards in initial testing.
Diffstat (limited to 'sys/dev/mmc')
-rw-r--r-- | sys/dev/mmc/mmc.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sys/dev/mmc/mmc.c b/sys/dev/mmc/mmc.c index a61da44..e8871c7 100644 --- a/sys/dev/mmc/mmc.c +++ b/sys/dev/mmc/mmc.c @@ -1381,17 +1381,18 @@ mmc_discover_cards(struct mmc_softc *sc) } /* - * We reselect the card here. Some cards become - * unselected and timeout with the above two commands, - * although the state tables / diagrams in the standard - * suggest they go back to the transfer state. The only - * thing we use from the sd_status is the erase sector - * size, but it is still nice to get that right. It is - * normally harmless for cards not misbehaving. The - * Atmel bridge will complain about this command timing - * out. Others seem to handle it correctly, so it may - * be a combination of card and controller. + * We deselect then reselect the card here. Some cards + * become unselected and timeout with the above two + * commands, although the state tables / diagrams in the + * standard suggest they go back to the transfer state. + * Other cards don't become deselected, and if we + * atttempt to blindly re-select them, we get timeout + * errors from some controllers. So we deselect then + * reselect to handle all situations. The only thing we + * use from the sd_status is the erase sector size, but + * it is still nice to get that right. */ + mmc_select_card(sc, 0); mmc_select_card(sc, ivar->rca); mmc_app_sd_status(sc, ivar->rca, ivar->raw_sd_status); mmc_app_decode_sd_status(ivar->raw_sd_status, |