diff options
-rw-r--r-- | sys/dev/sdmmc/sdhc.c | 4 | ||||
-rw-r--r-- | sys/dev/sdmmc/sdmmc.c | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/sdmmc/sdhc.c b/sys/dev/sdmmc/sdhc.c index 8195801caee..774a7247339 100644 --- a/sys/dev/sdmmc/sdhc.c +++ b/sys/dev/sdmmc/sdhc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdhc.c,v 1.26 2010/07/02 09:21:58 deraadt Exp $ */ +/* $OpenBSD: sdhc.c,v 1.27 2010/07/02 18:05:28 deraadt Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -272,6 +272,8 @@ sdhc_power(int why, void *arg) for (i = 0; i < sizeof hp->regs; i++) hp->regs[i] = HREAD1(hp, i); } + config_activate_children((struct device *)sc, + DVACT_SUSPEND); break; case PWR_RESUME: diff --git a/sys/dev/sdmmc/sdmmc.c b/sys/dev/sdmmc/sdmmc.c index 0aa21a3b21d..4b130f7c870 100644 --- a/sys/dev/sdmmc/sdmmc.c +++ b/sys/dev/sdmmc/sdmmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdmmc.c,v 1.21 2010/07/02 09:21:58 deraadt Exp $ */ +/* $OpenBSD: sdmmc.c,v 1.22 2010/07/02 18:05:28 deraadt Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -150,8 +150,12 @@ sdmmc_activate(struct device *self, int act) int rv = 0; switch (act) { + case DVACT_SUSPEND: + /* If card in slot, cause a detach/re-attach */ + if (ISSET(sc->sc_flags, SMF_CARD_PRESENT)) + sc->sc_dying = -1; + break; case DVACT_RESUME: - sc->sc_dying = -1; /* "bump" the task for a retry */ wakeup(&sc->sc_tskq); break; } |