summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpi/acpi.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2014-03-31 12:11:42 +0000
committermpi <mpi@openbsd.org>2014-03-31 12:11:42 +0000
commit6380ca9685512c994e5a792b9dbb2b7760474467 (patch)
treec03ed4c9fb7565ca1d2eab5dc8d9434073fad4d4 /sys/dev/acpi/acpi.c
parentRather than scanning local loop ids sequentially, just ask the chip which (diff)
downloadwireguard-openbsd-6380ca9685512c994e5a792b9dbb2b7760474467.tar.xz
wireguard-openbsd-6380ca9685512c994e5a792b9dbb2b7760474467.zip
Change the order of operations during a suspend/resume cycle and
call bufq_quiesce() after executing the DVACT_QUIESCE handlers. This should be safe since no disk nor controller drivers have such handler but it will allow us to detach sd(4) devices attached to a USB bus. Another benefit pointed out by kettenis@ is that drivers that need to read a firmware from the disk should be able to do it at resume time in a DVACT_WAKEUP handler. ok kettenis@, deraadt@
Diffstat (limited to 'sys/dev/acpi/acpi.c')
-rw-r--r--sys/dev/acpi/acpi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index be06c51ea35..9ede71c07a1 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.254 2014/03/13 03:52:56 dlg Exp $ */
+/* $OpenBSD: acpi.c,v 1.255 2014/03/31 12:11:42 mpi Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -2126,11 +2126,12 @@ acpi_sleep_state(struct acpi_softc *sc, int state)
#if NWSDISPLAY > 0
wsdisplay_suspend();
#endif /* NWSDISPLAY > 0 */
- bufq_quiesce();
if (config_suspend(mainbus, DVACT_QUIESCE))
goto fail_quiesce;
+ bufq_quiesce();
+
#ifdef MULTIPROCESSOR
acpi_sleep_mp();
#endif
@@ -2190,9 +2191,9 @@ fail_suspend:
acpi_resume_mp();
#endif
-fail_quiesce:
bufq_restart();
+fail_quiesce:
config_suspend(mainbus, DVACT_WAKEUP);
#if NWSDISPLAY > 0