Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/sdmmc Only use DETACH_FORCE as flags argument to sdm...



details:   https://anonhg.NetBSD.org/src/rev/597aecec6b92
branches:  trunk
changeset: 783429:597aecec6b92
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Thu Dec 20 14:24:11 2012 +0000

description:
Only use DETACH_FORCE as flags argument to sdmmc_card_detach when the
host controller has disappeared or is detaching.
XXX should pass flags from sdmmc_detach through to the task thread ending
to differentiate host controller disappearance from mere detachment.

diffstat:

 sys/dev/sdmmc/sdmmc.c |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (58 lines):

diff -r 8f545880f72b -r 597aecec6b92 sys/dev/sdmmc/sdmmc.c
--- a/sys/dev/sdmmc/sdmmc.c     Thu Dec 20 11:44:39 2012 +0000
+++ b/sys/dev/sdmmc/sdmmc.c     Thu Dec 20 14:24:11 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdmmc.c,v 1.17 2012/12/15 00:07:47 jakllsch Exp $      */
+/*     $NetBSD: sdmmc.c,v 1.18 2012/12/20 14:24:11 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.17 2012/12/15 00:07:47 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.18 2012/12/20 14:24:11 jakllsch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -308,7 +308,7 @@
        } else {
                if (ISSET(sc->sc_flags, SMF_CARD_PRESENT)) {
                        CLR(sc->sc_flags, SMF_CARD_PRESENT);
-                       sdmmc_card_detach(sc, DETACH_FORCE);
+                       sdmmc_card_detach(sc, 0);
                }
        }
 }
@@ -398,7 +398,7 @@
        return;
 
 err:
-       sdmmc_card_detach(sc, DETACH_FORCE);
+       sdmmc_card_detach(sc, 0);
 }
 
 /*
@@ -415,7 +415,7 @@
        if (ISSET(sc->sc_flags, SMF_CARD_ATTACHED)) {
                SIMPLEQ_FOREACH(sf, &sc->sf_head, sf_list) {
                        if (sf->child != NULL) {
-                               config_detach(sf->child, DETACH_FORCE);
+                               config_detach(sf->child, flags);
                                sf->child = NULL;
                        }
                }
@@ -425,8 +425,10 @@
                CLR(sc->sc_flags, SMF_CARD_ATTACHED);
        }
 
-       /* Power down. */
-       sdmmc_disable(sc);
+       if ((flags & DETACH_FORCE) == 0) {
+               /* Power down. */
+               sdmmc_disable(sc);
+       }
 
        /* Free all sdmmc_function structures. */
        for (sf = SIMPLEQ_FIRST(&sc->sf_head); sf != NULL; sf = sfnext) {



Home | Main Index | Thread Index | Old Index