summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormlarkin <mlarkin@openbsd.org>2016-08-31 15:40:42 +0000
committermlarkin <mlarkin@openbsd.org>2016-08-31 15:40:42 +0000
commitab31ea583ebb1f447fed1bb8a093affbc8bebbce (patch)
treef9ea6a411ca214790f03c8ba5c7b95f7faa33c19 /sys
parentsys/arch/sgi/hpc/wskbdmap_sgi.c should be regen'd too. (diff)
downloadwireguard-openbsd-ab31ea583ebb1f447fed1bb8a093affbc8bebbce.tar.xz
wireguard-openbsd-ab31ea583ebb1f447fed1bb8a093affbc8bebbce.zip
Don't put a device in the wake device list if _STA says it's not there.
Fixes at least one machine that woke up from sleep / poweroff immediately. ok kettenis@, tested by kettenis and martijn@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/acpi/acpi.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index a676d4551df..f7127d9a491 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.313 2016/07/28 21:57:56 kettenis Exp $ */
+/* $OpenBSD: acpi.c,v 1.314 2016/08/31 15:40:42 mlarkin Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -2110,6 +2110,13 @@ acpi_foundprw(struct aml_node *node, void *arg)
{
struct acpi_softc *sc = arg;
struct acpi_wakeq *wq;
+ int64_t sta;
+
+ if (aml_evalinteger(sc, node->parent, "_STA", 0, NULL, &sta))
+ sta = STA_PRESENT | STA_ENABLED | STA_DEV_OK | 0x1000;
+
+ if ((sta & STA_PRESENT) == 0)
+ return 0;
wq = malloc(sizeof(struct acpi_wakeq), M_DEVBUF, M_NOWAIT | M_ZERO);
if (wq == NULL)