summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-04-08 04:06:02 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-04-08 04:06:02 +0000
commitbc5b58cb1be02d4f6b7e376bdc6e903bf570b8d4 (patch)
treea903a8db06ac1c8ac898f3ae67a47044057f96af /sys/dev/acpi
parent0ba1d214704ecb9cdb9ac079bf77030ca7e09169 (diff)
Sensors are run as callbacks inside tasks. During suspend a sensor
could be running inside a driver that will be force-detached, or due to tsleep end up disrupting the softstate/hardstate contract. At suspend time, quisce all these callbacks by waiting for completion. This issue has never been observed for real, but may be implicated in suspend/resume failures. ok kettenis guenther mlarkin
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/acpi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index 33e5b1d7b66..09495657aad 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.327 2017/04/08 01:20:10 deraadt Exp $ */
+/* $OpenBSD: acpi.c,v 1.328 2017/04/08 04:06:01 deraadt Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -2405,6 +2405,7 @@ acpi_sleep_state(struct acpi_softc *sc, int sleepmode)
}
#endif /* HIBERNATE */
+ sensor_quiesce();
if (config_suspend_all(DVACT_QUIESCE))
goto fail_quiesce;
@@ -2484,6 +2485,7 @@ fail_suspend:
fail_quiesce:
config_suspend_all(DVACT_WAKEUP);
+ sensor_restart();
#ifdef HIBERNATE
if (sleepmode == ACPI_SLEEP_HIBERNATE) {