summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2012-10-08 21:47:52 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2012-10-08 21:47:52 +0000
commit4a7a1f17c7d6f8e79f29d4fde2ba5faf09b7f5a8 (patch)
treefdc5670bf4d0a8cd810fe846698cb565f1f51cb9 /sys/kern
parentc7f240fd53223122e6fe8cee52bb76b460263763 (diff)
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/kern')
-rw-r--r--sys/kern/subr_autoconf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c
index d43827e8db4..ff5c4313db9 100644
--- a/sys/kern/subr_autoconf.c
+++ b/sys/kern/subr_autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_autoconf.c,v 1.66 2011/07/03 15:47:16 matthew Exp $ */
+/* $OpenBSD: subr_autoconf.c,v 1.67 2012/10/08 21:47:50 deraadt Exp $ */
/* $NetBSD: subr_autoconf.c,v 1.21 1996/04/04 06:06:18 cgd Exp $ */
/*
@@ -802,6 +802,7 @@ config_activate_children(struct device *parent, int act)
case DVACT_SUSPEND:
case DVACT_RESUME:
case DVACT_QUIESCE:
+ case DVACT_POWERDOWN:
rv = config_suspend(d, act);
break;
case DVACT_DEACTIVATE:
@@ -822,6 +823,8 @@ config_activate_children(struct device *parent, int act)
#endif
if (act == DVACT_RESUME)
printf("failing resume cannot be handled\n");
+ if (act == DVACT_POWERDOWN)
+ return (rv);
if (act != DVACT_SUSPEND)
return (rv);