summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2010-07-02 18:05:28 +0000
committerderaadt <deraadt@openbsd.org>2010-07-02 18:05:28 +0000
commit9abbdf1007a5a89a2708e759b3618a8839f919dc (patch)
treee1358dba3ccbee23bfb4cf65f85c0b4b9c7ece7a /sys/dev
parentNot only for -tag lists, but for -hang, -ohang, -inset, -diag, (diff)
downloadwireguard-openbsd-9abbdf1007a5a89a2708e759b3618a8839f919dc.tar.xz
wireguard-openbsd-9abbdf1007a5a89a2708e759b3618a8839f919dc.zip
One transition was wrong: Suspending without a card, and then resuming with
was doing an attach, detach, and re-attach. Repair the state transitions.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/sdmmc/sdhc.c4
-rw-r--r--sys/dev/sdmmc/sdmmc.c8
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;
}