Module Name:    src
Committed By:   jakllsch
Date:           Sat Dec 22 20:21:09 UTC 2012

Modified Files:
        src/sys/dev/sdmmc: sdmmc.c

Log Message:
Revert sdmmc.c r1.18 (previous commit to this file).
It seems to have caused regressions to detaching drivers from cards at
the appropriate time.

DETACH_FORCE to sdmmc_card_detach really means the SD/SDIO card is gone,
and can not be abused to mean that the host controller disappered.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/sdmmc/sdmmc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sdmmc/sdmmc.c
diff -u src/sys/dev/sdmmc/sdmmc.c:1.18 src/sys/dev/sdmmc/sdmmc.c:1.19
--- src/sys/dev/sdmmc/sdmmc.c:1.18	Thu Dec 20 14:24:11 2012
+++ src/sys/dev/sdmmc/sdmmc.c	Sat Dec 22 20:21:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdmmc.c,v 1.18 2012/12/20 14:24:11 jakllsch Exp $	*/
+/*	$NetBSD: sdmmc.c,v 1.19 2012/12/22 20:21:09 jakllsch Exp $	*/
 /*	$OpenBSD: sdmmc.c,v 1.18 2009/01/09 10:58:38 jsg Exp $	*/
 
 /*
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.18 2012/12/20 14:24:11 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.19 2012/12/22 20:21:09 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -308,7 +308,7 @@ sdmmc_discover_task(void *arg)
 	} else {
 		if (ISSET(sc->sc_flags, SMF_CARD_PRESENT)) {
 			CLR(sc->sc_flags, SMF_CARD_PRESENT);
-			sdmmc_card_detach(sc, 0);
+			sdmmc_card_detach(sc, DETACH_FORCE);
 		}
 	}
 }
@@ -398,7 +398,7 @@ sdmmc_card_attach(struct sdmmc_softc *sc
 	return;
 
 err:
-	sdmmc_card_detach(sc, 0);
+	sdmmc_card_detach(sc, DETACH_FORCE);
 }
 
 /*
@@ -415,7 +415,7 @@ sdmmc_card_detach(struct sdmmc_softc *sc
 	if (ISSET(sc->sc_flags, SMF_CARD_ATTACHED)) {
 		SIMPLEQ_FOREACH(sf, &sc->sf_head, sf_list) {
 			if (sf->child != NULL) {
-				config_detach(sf->child, flags);
+				config_detach(sf->child, DETACH_FORCE);
 				sf->child = NULL;
 			}
 		}
@@ -425,10 +425,8 @@ sdmmc_card_detach(struct sdmmc_softc *sc
 		CLR(sc->sc_flags, SMF_CARD_ATTACHED);
 	}
 
-	if ((flags & DETACH_FORCE) == 0) {
-		/* Power down. */
-		sdmmc_disable(sc);
-	}
+	/* Power down. */
+	sdmmc_disable(sc);
 
 	/* Free all sdmmc_function structures. */
 	for (sf = SIMPLEQ_FIRST(&sc->sf_head); sf != NULL; sf = sfnext) {

Reply via email to