summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi_ec.c
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2007-03-20 00:58:19 +0000
committernjl <njl@FreeBSD.org>2007-03-20 00:58:19 +0000
commite12c81ac96571afbe73dcd1bd087927688fb075a (patch)
tree15f6366e0052b03417dca4d6a3d20da650f5a268 /sys/dev/acpica/acpi_ec.c
parent4ffc00490175f1ea8b4a87149bed2b0076df6f3b (diff)
downloadFreeBSD-src-e12c81ac96571afbe73dcd1bd087927688fb075a.zip
FreeBSD-src-e12c81ac96571afbe73dcd1bd087927688fb075a.tar.gz
If we got an OBE/IBF event, we failed to re-enable the GPE. This would
cause the EC to stop handling future events because the GPE stayed masked. Set a flag when queueing a GPE handler since it will ultimately re-enable the GPE. In all other cases, re-enable it ourselves. I reworked the patch from the submitter. Submitted by: Rong-en Fan <grafan@gmail.com>
Diffstat (limited to 'sys/dev/acpica/acpi_ec.c')
-rw-r--r--sys/dev/acpica/acpi_ec.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/dev/acpica/acpi_ec.c b/sys/dev/acpica/acpi_ec.c
index d099e01..8c7b2b9 100644
--- a/sys/dev/acpica/acpi_ec.c
+++ b/sys/dev/acpica/acpi_ec.c
@@ -787,6 +787,7 @@ EcGpeHandler(void *Context)
struct acpi_ec_softc *sc = Context;
ACPI_STATUS Status;
EC_STATUS EcStatus;
+ int query_pend;
KASSERT(Context != NULL, ("EcGpeHandler called with NULL"));
@@ -821,6 +822,7 @@ EcGpeHandler(void *Context)
* it along to any potential waiters as it may be an IBE/OBF event.
* If it is set, queue a query handler.
*/
+ query_pend = FALSE;
if ((EcStatus & EC_EVENT_SCI) == 0) {
CTR1(KTR_ACPI, "ec event was IBE/OBF, status %#x", EcStatus);
sc->ec_csrvalue = EcStatus;
@@ -832,12 +834,19 @@ EcGpeHandler(void *Context)
Context);
if (ACPI_SUCCESS(Status)) {
sc->ec_sci_pend = TRUE;
- } else {
+ query_pend = TRUE;
+ } else
printf("Queuing GPE query handler failed.\n");
- Status = AcpiEnableGpe(sc->ec_gpehandle, sc->ec_gpebit, ACPI_ISR);
- if (ACPI_FAILURE(Status))
- printf("EcGpeHandler: AcpiEnableEvent failed\n");
- }
+ }
+
+ /*
+ * If we didn't queue a query handler, which will eventually re-enable
+ * the GPE, re-enable it right now so we can get more events.
+ */
+ if (!query_pend) {
+ Status = AcpiEnableGpe(sc->ec_gpehandle, sc->ec_gpebit, ACPI_ISR);
+ if (ACPI_FAILURE(Status))
+ printf("EcGpeHandler: AcpiEnableGpe failed\n");
}
EcUnlock(sc);
OpenPOWER on IntegriCloud