diff options
author | 2014-04-25 14:37:06 +0000 | |
---|---|---|
committer | 2014-04-25 14:37:06 +0000 | |
commit | ec527653e3c18ef7989803fe457b94c85d781ed3 (patch) | |
tree | 9055125b66775f81f307d33f714da84ffe51772e /sys/dev/acpi/acpi.c | |
parent | Fix a minor optimization i broke in bsd.lv rev. 1.163 on August 20, 2010: (diff) | |
download | wireguard-openbsd-ec527653e3c18ef7989803fe457b94c85d781ed3.tar.xz wireguard-openbsd-ec527653e3c18ef7989803fe457b94c85d781ed3.zip |
Defer the free of the hibernate structures until later, when it is safe to
do so.
Freeing the hibernate structures too early leads to inadvertent calls into
splx when we aren't ready for them yet. Found when trapping splx calls in
the resume path.
discussed with deraadt@ at m2k14
Diffstat (limited to 'sys/dev/acpi/acpi.c')
-rw-r--r-- | sys/dev/acpi/acpi.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 759344b4b52..a045de8178b 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.256 2014/04/13 14:43:01 mlarkin Exp $ */ +/* $OpenBSD: acpi.c,v 1.257 2014/04/25 14:37:06 mlarkin Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -2202,6 +2202,14 @@ fail_quiesce: acpi_record_event(sc, APM_NORMAL_RESUME); acpi_indicator(sc, ACPI_SST_WORKING); + +#ifdef HIBERNATE + if (state == ACPI_STATE_S4) { + hibernate_free(); + uvm_pmr_dirty_everything(); + } +#endif /* HIBERNATE */ + fail_tts: return (error); } |