summaryrefslogtreecommitdiffstats
path: root/sys/dev/sdmmc
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2012-10-08 21:47:45 +0000
committerderaadt <deraadt@openbsd.org>2012-10-08 21:47:45 +0000
commit1e4b376cc93a4177cfbe219c9001277edc699d6c (patch)
tree3a10a5466f2dc80a042bbdf6dadcba6f503a8dee /sys/dev/sdmmc
parentdisk space is cheap but we still want to limit the default size of a body (diff)
downloadwireguard-openbsd-1e4b376cc93a4177cfbe219c9001277edc699d6c.tar.xz
wireguard-openbsd-1e4b376cc93a4177cfbe219c9001277edc699d6c.zip
Revamp the sequences for suspend/hibernate -> resume so that the code
paths are reflexive. It is now possible to fail part-way through a suspend sequence, and recover along the resume code path. Split DVACT_SUSPEND by adding a new DVACT_POWERDOWN method is used after hibernate (and suspend too) to finish the job. Some drivers must be converted at the same time to use this instead of shutdown hooks (the others will follow at a later time) ok kettenis mlarkin
Diffstat (limited to 'sys/dev/sdmmc')
-rw-r--r--sys/dev/sdmmc/sdhc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/sdmmc/sdhc.c b/sys/dev/sdmmc/sdhc.c
index 828e54284fb..9f8824661d5 100644
--- a/sys/dev/sdmmc/sdhc.c
+++ b/sys/dev/sdmmc/sdhc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdhc.c,v 1.34 2011/07/31 16:55:01 kettenis Exp $ */
+/* $OpenBSD: sdhc.c,v 1.35 2012/10/08 21:47:50 deraadt Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -271,6 +271,10 @@ sdhc_activate(struct device *self, int act)
}
rv = config_activate_children(self, act);
break;
+ case DVACT_POWERDOWN:
+ rv = config_activate_children(self, act);
+ sdhc_shutdown(self);
+ break;
case DVACT_RESUME:
/* Restore the host controller state. */
for (n = 0; n < sc->sc_nhosts; n++) {