The wakeup of the acpi thread is not needed. This code is being called
authorderaadt <deraadt@openbsd.org>
Sat, 7 Aug 2010 16:21:20 +0000 (16:21 +0000)
committerderaadt <deraadt@openbsd.org>
Sat, 7 Aug 2010 16:21:20 +0000 (16:21 +0000)
from inside the thread context, and will unwind into the middle of
acpi_thread, where it will check these variables
ok jordan marco kettenis canacar

sys/dev/acpi/acpibtn.c
sys/dev/acpi/acpisony.c
sys/dev/acpi/acpithinkpad.c

index 274c956..20cc016 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpibtn.c,v 1.32 2010/08/06 21:12:27 marco Exp $ */
+/* $OpenBSD: acpibtn.c,v 1.33 2010/08/07 16:21:20 deraadt Exp $ */
 /*
  * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
  *
@@ -197,10 +197,8 @@ acpibtn_notify(struct aml_node *node, int notify_type, void *arg)
                case 0x80:
 sleep:
                        /* Request to go to sleep */
-                       if (acpi_record_event(sc->sc_acpi, APM_USER_SUSPEND_REQ)) {
+                       if (acpi_record_event(sc->sc_acpi, APM_USER_SUSPEND_REQ))
                                sc->sc_acpi->sc_sleepmode = ACPI_STATE_S3;
-                               acpi_wakeup(sc->sc_acpi);
-                       }
                        break;
                }
 #endif /* SMALL_KERNEL */
index 627853f..716db37 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpisony.c,v 1.2 2010/07/27 06:12:50 deraadt Exp $ */
+/* $OpenBSD: acpisony.c,v 1.3 2010/08/07 16:21:20 deraadt Exp $ */
 /*
  * Copyright (c) 2010 Paul Irofti <pirofti@openbsd.org>
  *
@@ -197,10 +197,8 @@ acpisony_notify(struct aml_node *node, int notify, void *arg)
        case SONY_NOTIFY_SUSPEND_PRESSED:
                DPRINTF(("suspend-pressed\n"));
 #ifndef SMALL_KERNEL
-               if (acpi_record_event(sc->sc_acpi, APM_USER_SUSPEND_REQ)) {
+               if (acpi_record_event(sc->sc_acpi, APM_USER_SUSPEND_REQ))
                        sc->sc_acpi->sc_sleepmode = ACPI_STATE_S3;
-                       acpi_wakeup(sc->sc_acpi);
-               }
 #endif
                break;
        case SONY_NOTIFY_SUSPEND_RELEASED:
index e91b0ac..bfff207 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: acpithinkpad.c,v 1.23 2010/07/06 20:14:17 deraadt Exp $       */
+/*     $OpenBSD: acpithinkpad.c,v 1.24 2010/08/07 16:21:20 deraadt Exp $       */
 /*
  * Copyright (c) 2008 joshua stein <jcs@openbsd.org>
  *
@@ -283,10 +283,8 @@ thinkpad_hotkey(struct aml_node *node, int notify_type, void *arg)
                        break;
                case THINKPAD_BUTTON_SUSPEND:
 #ifndef SMALL_KERNEL
-                       if (acpi_record_event(sc->sc_acpi, APM_USER_SUSPEND_REQ)) {
+                       if (acpi_record_event(sc->sc_acpi, APM_USER_SUSPEND_REQ))
                                sc->sc_acpi->sc_sleepmode = ACPI_STATE_S3;
-                               acpi_wakeup(sc->sc_acpi);
-                       }
 #endif
                        handled = 1;
                        break;