Module Name: src
Committed By: alc
Date: Mon Jul 6 00:54:01 UTC 2009
Modified Files:
src/sys/dev/acpi: acpi_ec.c
Log Message:
Add a pmf(9) shutdown hook to acpiec(4) to use polling on shutdown.
This fixes DIAGNOSTIC's assertion failure:
cpu_switchto(): switching above IPL_SCHED
during ACPI shutdown.
OK'd by joerg@
To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/acpi/acpi_ec.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/acpi/acpi_ec.c
diff -u src/sys/dev/acpi/acpi_ec.c:1.55 src/sys/dev/acpi/acpi_ec.c:1.56
--- src/sys/dev/acpi/acpi_ec.c:1.55 Tue May 12 09:29:46 2009
+++ src/sys/dev/acpi/acpi_ec.c Mon Jul 6 00:54:00 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_ec.c,v 1.55 2009/05/12 09:29:46 cegger Exp $ */
+/* $NetBSD: acpi_ec.c,v 1.56 2009/07/06 00:54:00 alc Exp $ */
/*-
* Copyright (c) 2007 Joerg Sonnenberger <[email protected]>.
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.55 2009/05/12 09:29:46 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_ec.c,v 1.56 2009/07/06 00:54:00 alc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -148,8 +148,9 @@
static void acpiec_common_attach(device_t, device_t, ACPI_HANDLE,
bus_addr_t, bus_addr_t, ACPI_HANDLE, uint8_t);
-static bool acpiec_resume(device_t PMF_FN_PROTO);
static bool acpiec_suspend(device_t PMF_FN_PROTO);
+static bool acpiec_resume(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 *);
@@ -377,7 +378,8 @@
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;
@@ -409,6 +411,14 @@
}
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)
{