Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi ACPICA 20101209:



details:   https://anonhg.NetBSD.org/src/rev/90ec2bcbb2ef
branches:  trunk
changeset: 762191:90ec2bcbb2ef
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Thu Feb 17 10:49:29 2011 +0000

description:
ACPICA 20101209:

Completed the major overhaul of the GPE support code that was begun in July
2010. Major features include: removal of _PRW execution in ACPICA (host
executes _PRWs anyway), cleanup of "wake" GPE interfaces and processing,
changes to existing interfaces, simplification of GPE handler operation, and
a handful of new interfaces:

    AcpiUpdateAllGpes
    AcpiFinishGpe
    AcpiSetupGpeForWake
    AcpiSetGpeWakeMask

ACPICA 20100702:

Implemented several updates to the recently added GPE reference count
support. The model for "wake" GPEs is changing to give the host OS complete
control of these GPEs. Eventually, the ACPICA core will not execute any _PRW
methods, since the host already must execute them. Also, additional changes
were made to help ensure that the reference counts are kept in proper
synchronization with reality. Rafael J. Wysocki.

1) Ensure that GPEs are not enabled twice during initialization.
2) Ensure that GPE enable masks stay in sync with the reference count.
3) Do not inadvertently enable GPEs when writing GPE registers.
4) Remove the internal wake reference counter and add new AcpiGpeWakeup
interface. This interface will set or clear individual GPEs for wakeup.
5) Remove GpeType argument from AcpiEnable and AcpiDisable. These interfaces
are now used for "runtime" GPEs only.

diffstat:

 sys/dev/acpi/acpi_ec.c      |  10 +++++-----
 sys/dev/acpi/acpi_wakedev.c |  15 ++++++++++-----
 2 files changed, 15 insertions(+), 10 deletions(-)

diffs (84 lines):

diff -r e18d2f1ddab3 -r 90ec2bcbb2ef sys/dev/acpi/acpi_ec.c
--- a/sys/dev/acpi/acpi_ec.c    Thu Feb 17 10:35:50 2011 +0000
+++ b/sys/dev/acpi/acpi_ec.c    Thu Feb 17 10:49:29 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: acpi_ec.c,v 1.68 2011/01/07 14:08:29 cegger Exp $      */
+/*     $NetBSD: acpi_ec.c,v 1.69 2011/02/17 10:49:29 jruoho Exp $      */
 
 /*-
  * Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.68 2011/01/07 14:08:29 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.69 2011/02/17 10:49:29 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/callout.h>
@@ -161,7 +161,7 @@
 
 static void acpiec_callout(void *);
 static void acpiec_gpe_query(void *);
-static uint32_t acpiec_gpe_handler(void *);
+static uint32_t acpiec_gpe_handler(ACPI_HANDLE, uint32_t, void *);
 static ACPI_STATUS acpiec_space_setup(ACPI_HANDLE, uint32_t, void *, void **);
 static ACPI_STATUS acpiec_space_handler(uint32_t, ACPI_PHYSICAL_ADDRESS,
     uint32_t, ACPI_INTEGER *, void *, void *);
@@ -366,7 +366,7 @@
                goto post_csr_map;
        }
 
-       rv = AcpiEnableGpe(sc->sc_gpeh, sc->sc_gpebit, ACPI_GPE_TYPE_RUNTIME);
+       rv = AcpiEnableGpe(sc->sc_gpeh, sc->sc_gpebit);
        if (rv != AE_OK) {
                aprint_error_dev(self, "unable to enable GPE: %s\n",
                    AcpiFormatException(rv));
@@ -844,7 +844,7 @@
 }
 
 static uint32_t
-acpiec_gpe_handler(void *arg)
+acpiec_gpe_handler(ACPI_HANDLE hdl, uint32_t gpebit, void *arg)
 {
        device_t dv = arg;
        struct acpiec_softc *sc = device_private(dv);
diff -r e18d2f1ddab3 -r 90ec2bcbb2ef sys/dev/acpi/acpi_wakedev.c
--- a/sys/dev/acpi/acpi_wakedev.c       Thu Feb 17 10:35:50 2011 +0000
+++ b/sys/dev/acpi/acpi_wakedev.c       Thu Feb 17 10:49:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_wakedev.c,v 1.20 2011/01/02 12:06:02 jruoho Exp $ */
+/* $NetBSD: acpi_wakedev.c,v 1.21 2011/02/17 10:49:29 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2009, 2010 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_wakedev.c,v 1.20 2011/01/02 12:06:02 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_wakedev.c,v 1.21 2011/02/17 10:49:29 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -287,12 +287,17 @@
                acpi_wakedev_power(ad, obj);
 
        /*
-        * Set both runtime and wake GPEs, but unset only wake GPEs.
+        * This affects only wake GPEs, provided that _PRW works.
         */
        if (enable != 0)
-               (void)AcpiEnableGpe(hdl, val, ACPI_GPE_TYPE_WAKE_RUN);
+               (void)AcpiSetGpe(hdl, val, ACPI_GPE_ENABLE);
        else
-               (void)AcpiDisableGpe(hdl, val, ACPI_GPE_TYPE_WAKE);
+               (void)AcpiSetGpe(hdl, val, ACPI_GPE_DISABLE);
+
+       /*
+        * XXX: Is this right?
+        */
+       (void)AcpiUpdateAllGpes();
 
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "wake GPE %s for %s\n",
                (enable != 0) ? "enabled" : "disabled", ad->ad_name));



Home | Main Index | Thread Index | Old Index