summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-11-19 15:40:23 +0000
committerjhb <jhb@FreeBSD.org>2003-11-19 15:40:23 +0000
commite9c1e3387f290e428491955ba285c2e8f45683a8 (patch)
treed8fc498a1b88d2f241a0e1ea4cc5377de04f98ec /sys/i386/isa
parent1e7f54677c41894d0ec6c5cb3206b79189681983 (diff)
downloadFreeBSD-src-e9c1e3387f290e428491955ba285c2e8f45683a8.zip
FreeBSD-src-e9c1e3387f290e428491955ba285c2e8f45683a8.tar.gz
Add a special check for a stray IRQ 7 or IRQ 15 to see if it is actually
a spurious interrupt from one of the 8259As. If so, don't log it as a stray IRQ, but just silently ignore it. Approved by: re (rwatson)
Diffstat (limited to 'sys/i386/isa')
-rw-r--r--sys/i386/isa/atpic.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/i386/isa/atpic.c b/sys/i386/isa/atpic.c
index 2f8c78c..7252cbf 100644
--- a/sys/i386/isa/atpic.c
+++ b/sys/i386/isa/atpic.c
@@ -343,6 +343,28 @@ atpic_handle_intr(struct intrframe iframe)
KASSERT((uint)iframe.if_vec < ICU_LEN,
("unknown int %d\n", iframe.if_vec));
isrc = &atintrs[iframe.if_vec].at_intsrc;
+
+ /*
+ * If we don't have an ithread, see if this is a spurious
+ * interrupt.
+ */
+ if (isrc->is_ithread == NULL &&
+ (iframe.if_vec == 7 || iframe.if_vec == 15)) {
+ int port, isr;
+
+ /*
+ * Read the ISR register to see if IRQ 7/15 is really
+ * pending. Reset read register back to IRR when done.
+ */
+ port = ((struct atpic *)isrc->is_pic)->at_ioaddr;
+ mtx_lock_spin(&icu_lock);
+ outb(port, OCW3_SEL | OCW3_RR | OCW3_RIS);
+ isr = inb(port);
+ outb(port, OCW3_SEL | OCW3_RR);
+ mtx_unlock_spin(&icu_lock);
+ if ((isr & IRQ7) == 0)
+ return;
+ }
intr_execute_handlers(isrc, &iframe);
}
OpenPOWER on IntegriCloud