From 6b5677e60d1f0efadd1893add6d7b5cbc6854cf9 Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 1 Feb 2022 18:09:00 +0000 Subject: [PATCH] GPE_DIRECT is calling the AML parser from interrupt context, which is not permitted. Luckily nothing is using GPE_DIRECT anymore, so this code can be deleted. ok kettenis --- sys/dev/acpi/acpi.c | 22 +++++----------------- sys/dev/acpi/acpivar.h | 3 +-- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index dd0c4d1e847..acbaa1b07c0 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.406 2022/01/26 14:39:07 kettenis Exp $ */ +/* $OpenBSD: acpi.c,v 1.407 2022/02/01 18:09:00 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Jordan Hargrave @@ -2092,21 +2092,9 @@ acpi_interrupt(void *arg) /* Signal this GPE */ gpe = idx + jdx; - if (sc->gpe_table[gpe].flags & GPE_DIRECT) { - dnprintf(10, "directly handle gpe: %x\n", - gpe); - sc->gpe_table[gpe].handler(sc, gpe, - sc->gpe_table[gpe].arg); - if (sc->gpe_table[gpe].flags & - GPE_LEVEL) - acpi_gpe(sc, gpe, - sc->gpe_table[gpe].arg); - } else { - sc->gpe_table[gpe].active = 1; - dnprintf(10, "queue gpe: %x\n", gpe); - acpi_addtask(sc, acpi_gpe_task, NULL, - gpe); - } + sc->gpe_table[gpe].active = 1; + dnprintf(10, "queue gpe: %x\n", gpe); + acpi_addtask(sc, acpi_gpe_task, NULL, gpe); /* * Edge interrupts need their STS bits cleared @@ -2281,7 +2269,7 @@ acpi_set_gpehandler(struct acpi_softc *sc, int gpe, int (*handler) return -EINVAL; if (!(flags & (GPE_LEVEL | GPE_EDGE))) return -EINVAL; - if (ptbl->handler != NULL && !(flags & GPE_DIRECT)) + if (ptbl->handler != NULL) printf("%s: GPE 0x%.2x already enabled\n", DEVNAME(sc), gpe); dnprintf(50, "Adding GPE handler 0x%.2x (%s)\n", gpe, diff --git a/sys/dev/acpi/acpivar.h b/sys/dev/acpi/acpivar.h index ff544e70911..9058193e4b4 100644 --- a/sys/dev/acpi/acpivar.h +++ b/sys/dev/acpi/acpivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: acpivar.h,v 1.116 2022/01/12 11:18:30 patrick Exp $ */ +/* $OpenBSD: acpivar.h,v 1.117 2022/02/01 18:09:00 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * @@ -295,7 +295,6 @@ extern struct acpi_softc *acpi_softc; #define GPE_NONE 0x00 #define GPE_LEVEL 0x01 #define GPE_EDGE 0x02 -#define GPE_DIRECT 0x04 struct acpi_table { int offset; -- 2.20.1