summaryrefslogtreecommitdiff
path: root/sys/dev/i2c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2024-08-18 11:08:48 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2024-08-18 11:08:48 +0000
commit71e8cffcd22ed823f2acd54745a359c37290db8a (patch)
tree47729a05fcb2b1ef959a256925f8ed8e3f054a5a /sys/dev/i2c
parent6f31cc660e2bcf78f494d9aba8f84839421a9cfc (diff)
Don't short-circuit interrupt handling when the sc_dying flag is set. Just
don't forward reports to the child drivers instead. This fixes an issue with hardware that sends an interrupt in response to a reset request when a level-triggered interrupt is used. In that case the interrupt would just keep triggering when we issue a reset when we resume (when sc_dying is set) since we didn't clear the interrupt condition by reading from the device. ok mlarkin@, deraadt@
Diffstat (limited to 'sys/dev/i2c')
-rw-r--r--sys/dev/i2c/ihidev.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/i2c/ihidev.c b/sys/dev/i2c/ihidev.c
index a735b015f7f..80f730998fc 100644
--- a/sys/dev/i2c/ihidev.c
+++ b/sys/dev/i2c/ihidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ihidev.c,v 1.30 2024/08/18 03:25:04 deraadt Exp $ */
+/* $OpenBSD: ihidev.c,v 1.31 2024/08/18 11:08:47 kettenis Exp $ */
/*
* HID-over-i2c driver
*
@@ -632,9 +632,6 @@ ihidev_intr(void *arg)
u_char *p;
u_int rep = 0;
- if (sc->sc_dying)
- return 1;
-
if (sc->sc_poll && !sc->sc_frompoll) {
DPRINTF(("%s: received interrupt while polling, disabling "
"polling\n", sc->sc_dev.dv_xname));
@@ -711,7 +708,8 @@ ihidev_intr(void *arg)
return (1);
}
- scd->sc_intr(scd, p, psize);
+ if (!sc->sc_dying)
+ scd->sc_intr(scd, p, psize);
if (sc->sc_poll && (fast != sc->sc_fastpoll)) {
DPRINTF(("%s: %s->%s polling\n", sc->sc_dev.dv_xname,