summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-12-07 14:33:27 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-12-07 14:33:27 +0000
commitf2014a25a75a20aae3f5d03c818ac451438354ed (patch)
tree43392ab60fd110a76dfd9739017f0934c1daa956 /sys/arch/i386
parent2e337f9c11e25ca2db4b76eff16a6138f4e0f829 (diff)
Make acpiprt(4) check whether the current interrupt routing is "possible" and
pick a new one from the list of possible routings if it isn't or if a pin is currently not routed. Delay re-routing interrupts until we establish a handler for it. This prevents us from messing with unused interrupt pins which may have fatal consequences (some machines spontaniously reboot). The heuristics for picking an interrupt from the list of possibe ones probably needs some tweaking still, but this makes several NVIDIA-based boards work much better than before. tested by many, ok marco@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/pci/pci_intr_fixup.c3
-rw-r--r--sys/arch/i386/pci/pci_machdep.c14
2 files changed, 14 insertions, 3 deletions
diff --git a/sys/arch/i386/pci/pci_intr_fixup.c b/sys/arch/i386/pci/pci_intr_fixup.c
index e2c64461feb..a8aa0c7a5da 100644
--- a/sys/arch/i386/pci/pci_intr_fixup.c
+++ b/sys/arch/i386/pci/pci_intr_fixup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_intr_fixup.c,v 1.61 2008/06/26 05:42:11 ray Exp $ */
+/* $OpenBSD: pci_intr_fixup.c,v 1.62 2008/12/07 14:33:26 kettenis Exp $ */
/* $NetBSD: pci_intr_fixup.c,v 1.10 2000/08/10 21:18:27 soda Exp $ */
/*
@@ -662,7 +662,6 @@ pci_intr_header_fixup(pci_chipset_tag_t pc, pcitag_t tag,
irq = ihp->line & APIC_INT_LINE_MASK;
ihp->link = NULL;
- ihp->tag = tag;
pci_decompose_tag(pc, tag, &bus, &device, &function);
if ((pir = pciintr_pir_lookup(bus, device)) == NULL ||
diff --git a/sys/arch/i386/pci/pci_machdep.c b/sys/arch/i386/pci/pci_machdep.c
index 0a0e3f84a0b..c39f07cd904 100644
--- a/sys/arch/i386/pci/pci_machdep.c
+++ b/sys/arch/i386/pci/pci_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.c,v 1.41 2008/12/03 15:46:07 oga Exp $ */
+/* $OpenBSD: pci_machdep.c,v 1.42 2008/12/07 14:33:26 kettenis Exp $ */
/* $NetBSD: pci_machdep.c,v 1.28 1997/06/06 23:29:17 thorpej Exp $ */
/*-
@@ -426,6 +426,7 @@ pci_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp)
goto bad;
}
+ ihp->tag = pa->pa_intrtag;
ihp->line = line;
ihp->pin = pin;
@@ -550,13 +551,24 @@ pci_intr_string(pci_chipset_tag_t pc, pci_intr_handle_t ih)
return (irqstr);
}
+#include "acpiprt.h"
+#if NACPIPRT > 0
+void acpiprt_route_interrupt(int bus, int dev, int pin);
+#endif
+
void *
pci_intr_establish(pci_chipset_tag_t pc, pci_intr_handle_t ih, int level,
int (*func)(void *), void *arg, char *what)
{
void *ret;
+ int bus, dev;
int l = ih.line & APIC_INT_LINE_MASK;
+ pci_decompose_tag(pc, ih.tag, &bus, &dev, NULL);
+#if NACPIPRT > 0
+ acpiprt_route_interrupt(bus, dev, ih.pin);
+#endif
+
#if NIOAPIC > 0
if (l != -1 && ih.line & APIC_INT_VIA_APIC)
return (apic_intr_establish(ih.line, IST_LEVEL, level, func,