diff options
author | 2013-05-31 21:28:31 +0000 | |
---|---|---|
committer | 2013-05-31 21:28:31 +0000 | |
commit | 00c76a70b005bc9dfcc56812a9b4915ff8b3093c (patch) | |
tree | ec7563e843e9e8fe945fffcd6b7f47006bde1301 /sys/dev/sdmmc | |
parent | doesn't need any headers (diff) | |
download | wireguard-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/sdmmc')
-rw-r--r-- | sys/dev/sdmmc/sdhc.c | 6 | ||||
-rw-r--r-- | sys/dev/sdmmc/sdmmc.c | 13 |
2 files changed, 13 insertions, 6 deletions
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 |