summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2016-05-04 08:30:56 +0000
committerkettenis <kettenis@openbsd.org>2016-05-04 08:30:56 +0000
commit239ff9394cbdd9910ed97c743dc63f5827b4e6a0 (patch)
tree32d9542f831cd948c2172ab0f6e816995eec32ac
parentFall back to "safe-value" when "unmanage-value" is not evailable to (diff)
downloadwireguard-openbsd-239ff9394cbdd9910ed97c743dc63f5827b4e6a0.tar.xz
wireguard-openbsd-239ff9394cbdd9910ed97c743dc63f5827b4e6a0.zip
Don't mask pins configured as direct IRQ. Those are tied directly to the APIC
and don't generate a GPIO controller interrupt. Masking them menas devices relying on those APIC interrupts will break. Unbreaks the keyboard on the Asus x205ta, which got broken in rev 1.6.
-rw-r--r--sys/dev/acpi/bytgpio.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/acpi/bytgpio.c b/sys/dev/acpi/bytgpio.c
index 6340f66073e..11654f545ed 100644
--- a/sys/dev/acpi/bytgpio.c
+++ b/sys/dev/acpi/bytgpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bytgpio.c,v 1.7 2016/05/03 22:17:57 kettenis Exp $ */
+/* $OpenBSD: bytgpio.c,v 1.8 2016/05/04 08:30:56 kettenis Exp $ */
/*
* Copyright (c) 2016 Mark Kettenis
*
@@ -29,6 +29,7 @@
#define BYTGPIO_CONF_GD_TPE 0x02000000
#define BYTGPIO_CONF_GD_TNE 0x04000000
#define BYTGPIO_CONF_GD_MASK 0x07000000
+#define BYTGPIO_CONF_DIRECT_IRQ_EN 0x08000000
#define BYTGPIO_PAD_VAL 0x00000001
@@ -199,6 +200,14 @@ bytgpio_attach(struct device *parent, struct device *self, void *aux)
/* Mask all interrupts. */
for (i = 0; i < sc->sc_npins; i++) {
reg = bus_space_read_4(sc->sc_memt, sc->sc_memh, sc->sc_pins[i] * 16);
+
+ /*
+ * Skip pins configured as direct IRQ. Those are tied
+ * directly to the APIC.
+ */
+ if (reg & BYTGPIO_CONF_DIRECT_IRQ_EN)
+ continue;
+
reg &= ~BYTGPIO_CONF_GD_MASK;
bus_space_write_4(sc->sc_memt, sc->sc_memh, sc->sc_pins[i] * 16, reg);
}