summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_hibernate.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2013-01-17 02:36:45 +0000
committerderaadt <deraadt@openbsd.org>2013-01-17 02:36:45 +0000
commit73cbb718ecead20d796f01818d9c7c01c532d6c3 (patch)
tree4f7fdcfb8b75be8ec32eb06700a18502a2656961 /sys/kern/subr_hibernate.c
parentFixup printing of rdomain configs -- add network statements and only print (diff)
downloadwireguard-openbsd-73cbb718ecead20d796f01818d9c7c01c532d6c3.tar.xz
wireguard-openbsd-73cbb718ecead20d796f01818d9c7c01c532d6c3.zip
Add a hibernate HIB_DONE op. After the memory-side-effect driver finishes
IO to the disk, DVACT_RESUME the controller back to normal operation. That allows us to do the full DVACT_POWERDOWN sequence afterwards. ok mlarkin
Diffstat (limited to 'sys/kern/subr_hibernate.c')
-rw-r--r--sys/kern/subr_hibernate.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/subr_hibernate.c b/sys/kern/subr_hibernate.c
index 5a74da52cef..c5b1d39918f 100644
--- a/sys/kern/subr_hibernate.c
+++ b/sys/kern/subr_hibernate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_hibernate.c,v 1.48 2013/01/17 01:28:01 mlarkin Exp $ */
+/* $OpenBSD: subr_hibernate.c,v 1.49 2013/01/17 02:36:45 deraadt Exp $ */
/*
* Copyright (c) 2011 Ariane van der Steldt <ariane@stack.nl>
@@ -1812,7 +1812,12 @@ hibernate_suspend(void)
if (hibernate_write_signature(&hib_info))
return (1);
+ /* Allow the disk to settle */
delay(500000);
+
+ hib_info.io_func(hib_info.device, 0, (vaddr_t)NULL, 0,
+ HIB_DONE, hib_info.io_page);
+
return (0);
}