summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2013-05-31 21:28:31 +0000
committerderaadt <deraadt@openbsd.org>2013-05-31 21:28:31 +0000
commit00c76a70b005bc9dfcc56812a9b4915ff8b3093c (patch)
treeec7563e843e9e8fe945fffcd6b7f47006bde1301 /sys/dev
parentdoesn't need any headers (diff)
downloadwireguard-openbsd-00c76a70b005bc9dfcc56812a9b4915ff8b3093c.tar.xz
wireguard-openbsd-00c76a70b005bc9dfcc56812a9b4915ff8b3093c.zip
Correct sequencing in ca_activate function. Some operations were in the
wrong order, and depth traversal was not gauranteed. ok stsp (tested too)
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/rtsx.c5
-rw-r--r--sys/dev/sdmmc/sdhc.c6
-rw-r--r--sys/dev/sdmmc/sdmmc.c13
3 files changed, 15 insertions, 9 deletions
diff --git a/sys/dev/ic/rtsx.c b/sys/dev/ic/rtsx.c
index cb5b0eca72a..a584d6a7ca9 100644
--- a/sys/dev/ic/rtsx.c
+++ b/sys/dev/ic/rtsx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsx.c,v 1.3 2013/03/28 20:03:19 stsp Exp $ */
+/* $OpenBSD: rtsx.c,v 1.4 2013/05/31 21:28:31 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -283,12 +283,11 @@ rtsx_activate(struct device *self, int act)
switch (act) {
case DVACT_QUIESCE:
- /* XXX abort commands in progress? */
rv = config_activate_children(self, act);
break;
case DVACT_SUSPEND:
- rtsx_save_regs(sc);
rv = config_activate_children(self, act);
+ rtsx_save_regs(sc);
break;
case DVACT_POWERDOWN:
rv = config_activate_children(self, act);
diff --git a/sys/dev/sdmmc/sdhc.c b/sys/dev/sdmmc/sdhc.c
index 9f8824661d5..3b6b3199ea6 100644
--- a/sys/dev/sdmmc/sdhc.c
+++ b/sys/dev/sdmmc/sdhc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdhc.c,v 1.35 2012/10/08 21:47:50 deraadt Exp $ */
+/* $OpenBSD: sdhc.c,v 1.36 2013/05/31 21:28:32 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -260,8 +260,7 @@ sdhc_activate(struct device *self, int act)
rv = config_activate_children(self, act);
break;
case DVACT_SUSPEND:
- /* XXX poll for command completion or suspend command
- * in progress */
+ rv = config_activate_children(self, act);
/* Save the host controller state. */
for (n = 0; n < sc->sc_nhosts; n++) {
@@ -269,7 +268,6 @@ sdhc_activate(struct device *self, int act)
for (i = 0; i < sizeof hp->regs; i++)
hp->regs[i] = HREAD1(hp, i);
}
- rv = config_activate_children(self, act);
break;
case DVACT_POWERDOWN:
rv = config_activate_children(self, act);
diff --git a/sys/dev/sdmmc/sdmmc.c b/sys/dev/sdmmc/sdmmc.c
index 2f53c264252..295bce3fab1 100644
--- a/sys/dev/sdmmc/sdmmc.c
+++ b/sys/dev/sdmmc/sdmmc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdmmc.c,v 1.26 2011/11/14 14:13:45 deraadt Exp $ */
+/* $OpenBSD: sdmmc.c,v 1.27 2013/05/31 21:28:32 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -146,18 +146,27 @@ int
sdmmc_activate(struct device *self, int act)
{
struct sdmmc_softc *sc = (struct sdmmc_softc *)self;
+ int rv = 0;
switch (act) {
+ case DVACT_QUIESCE:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_SUSPEND:
+ rv = config_activate_children(self, act);
/* If card in slot, cause a detach/re-attach */
if (ISSET(sc->sc_flags, SMF_CARD_PRESENT))
sc->sc_dying = -1;
break;
+ case DVACT_POWERDOWN:
+ rv = config_activate_children(self, act);
+ break;
case DVACT_RESUME:
wakeup(&sc->sc_tskq);
+ rv = config_activate_children(self, act);
break;
}
- return (0);
+ return (rv);
}
void