summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2016-08-31 15:40:43 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2016-08-31 15:40:43 +0000
commit24e5a5c2fde1554fdff944d4a74af71459dcb3ec (patch)
tree95f6a645ab9acc974e45b984f2bf471474289a4f
parent827e39111e777be2fe688a392c546c8fec664c95 (diff)
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@
-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)