Current-Users archive

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

Re: Current on a Dell OptiPlex 760



Mark Davies wrote:
Trying to get -current running on an OptiPlex 760 and it generally runs but I've found two glitches so far:

1) When you "halt -p", file systems unmount, kernel prints

        acpi0: entering state 5

but it never powers off.

Does this patch help?

Cheers,
Jared
Index: acpi_ec.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpi_ec.c,v
retrieving revision 1.52
diff -u -p -r1.52 acpi_ec.c
--- acpi_ec.c   3 Jun 2008 15:12:39 -0000       1.52
+++ acpi_ec.c   30 Oct 2008 00:37:26 -0000
@@ -150,6 +150,7 @@ static void acpiec_common_attach(device_
 
 static bool acpiec_resume(device_t PMF_FN_PROTO);
 static bool acpiec_suspend(device_t PMF_FN_PROTO);
+static bool acpiec_shutdown(device_t, int);
 
 static bool acpiec_parse_gpe_package(device_t, ACPI_HANDLE,
     ACPI_HANDLE *, uint8_t *);
@@ -170,7 +171,7 @@ CFATTACH_DECL_NEW(acpiecdt, sizeof(struc
     acpiecdt_match, acpiecdt_attach, NULL, NULL);
 
 static device_t ec_singleton = NULL;
-static bool acpiec_cold = false;
+bool acpiec_cold = false;
 
 static bool
 acpiecdt_find(device_t parent, ACPI_HANDLE *ec_handle,
@@ -380,7 +381,8 @@ acpiec_common_attach(device_t parent, de
 
        ec_singleton = self;
 
-       if (!pmf_device_register(self, acpiec_suspend, acpiec_resume))
+       if (!pmf_device_register1(self,
+           acpiec_suspend, acpiec_resume, acpiec_shutdown))
                aprint_error_dev(self, "couldn't establish power handler\n");
 
        return;
@@ -412,6 +414,14 @@ acpiec_resume(device_t dv PMF_FN_ARGS)
 }
 
 static bool
+acpiec_shutdown(device_t dv, int how)
+{
+       acpiec_cold = true;
+
+       return true;
+}
+
+static bool
 acpiec_parse_gpe_package(device_t self, ACPI_HANDLE ec_handle,
     ACPI_HANDLE *gpe_handle, uint8_t *gpebit)
 {
Index: acpica/OsdSchedule.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpica/OsdSchedule.c,v
retrieving revision 1.8
diff -u -p -r1.8 OsdSchedule.c
--- acpica/OsdSchedule.c        31 May 2008 21:38:02 -0000      1.8
+++ acpica/OsdSchedule.c        30 Oct 2008 00:37:26 -0000
@@ -61,6 +61,8 @@ __KERNEL_RCSID(0, "$NetBSD: OsdSchedule.
 #define        _COMPONENT      ACPI_OS_SERVICES
 ACPI_MODULE_NAME("SCHEDULE")
 
+extern bool acpiec_cold;
+
 static kcondvar_t      acpi_osd_sleep_cv;
 static kmutex_t                acpi_osd_sleep_mtx;
 
@@ -163,7 +165,7 @@ AcpiOsSleep(ACPI_INTEGER Milliseconds)
 {
        ACPI_FUNCTION_TRACE(__func__);
 
-       if (cold)
+       if (cold || acpiec_cold)
                DELAY(Milliseconds * 1000);
        else {
                mutex_enter(&acpi_osd_sleep_mtx);
Index: acpica/OsdSynch.c
===================================================================
RCS file: /cvsroot/src/sys/dev/acpi/acpica/OsdSynch.c,v
retrieving revision 1.10
diff -u -p -r1.10 OsdSynch.c
--- acpica/OsdSynch.c   15 Dec 2007 00:39:25 -0000      1.10
+++ acpica/OsdSynch.c   30 Oct 2008 00:37:26 -0000
@@ -85,6 +85,8 @@ MALLOC_DECLARE(M_ACPI);
 #define        _COMPONENT      ACPI_OS_SERVICES
 ACPI_MODULE_NAME("SYNCH")
 
+extern bool acpiec_cold;
+
 /*
  * Simple counting semaphore implemented using a mutex.  This is
  * subsequently used in the OSI code to implement a mutex.  Go figure.
@@ -181,7 +183,7 @@ AcpiOsWaitSemaphore(ACPI_SEMAPHORE Handl
 
        if (as == NULL)
                return_ACPI_STATUS(AE_BAD_PARAMETER);
-       if (cold)
+       if (cold || acpiec_cold)
                return_ACPI_STATUS(AE_OK);
 
        /* A timeout of 0xFFFF means "forever". */


Home | Main Index | Thread Index | Old Index