From 1d62e1d8c88c4698a7d8da6a510fb1c7d6da9cf1 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 15 Sep 2012 03:17:17 +0200 Subject: [PATCH] usb: dont give up on unassigned pci irq line in hci driver sometimes, the bios does not assign a interrupt line for pci devices. this should not be fatal in case of mp ineterrupts as long as there is intpin or msi can be used. warn in intrenable() if we hit such a interrupt and set irq to -1 to prevent it from getting enabled on the pic or as isa interrupt in apic mode. --- sys/src/9/pc/trap.c | 6 ++++++ sys/src/9/pc/usbehcipc.c | 4 ---- sys/src/9/pc/usbohci.c | 4 ---- sys/src/9/pc/usbuhci.c | 4 ---- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/sys/src/9/pc/trap.c b/sys/src/9/pc/trap.c index 0593784fb..65915e06c 100644 --- a/sys/src/9/pc/trap.c +++ b/sys/src/9/pc/trap.c @@ -40,6 +40,12 @@ intrenable(int irq, void (*f)(Ureg*, void*), void* a, int tbdf, char *name) return; } + if(tbdf != BUSUNKNOWN && (irq == 0xff || irq == 0)){ + print("intrenable: got unassigned irq %d, tbdf 0x%uX for %s\n", + irq, tbdf, name); + irq = -1; + } + if((v = xalloc(sizeof(Vctl))) == nil) panic("intrenable: out of memory"); v->isintr = 1; diff --git a/sys/src/9/pc/usbehcipc.c b/sys/src/9/pc/usbehcipc.c index b1394c039..20b09e3f9 100644 --- a/sys/src/9/pc/usbehcipc.c +++ b/sys/src/9/pc/usbehcipc.c @@ -172,10 +172,6 @@ scanpci(void) p->vid, p->did); continue; } - if(p->intl == 0xff || p->intl == 0) { - print("usbehci: no irq assigned for port %#lux\n", io); - continue; - } dprint("usbehci: %#x %#x: port %#lux size %#x irq %d\n", p->vid, p->did, io, p->mem[0].size, p->intl); diff --git a/sys/src/9/pc/usbohci.c b/sys/src/9/pc/usbohci.c index eee329238..522a8df39 100644 --- a/sys/src/9/pc/usbohci.c +++ b/sys/src/9/pc/usbohci.c @@ -2382,10 +2382,6 @@ scanpci(void) print("usbohci: failed to map registers\n"); continue; } - if(p->intl == 0xFF || p->intl == 0) { - print("usbohci: no irq assigned for port %#lux\n", mem); - continue; - } ctlr = malloc(sizeof(Ctlr)); if(ctlr == nil){ diff --git a/sys/src/9/pc/usbuhci.c b/sys/src/9/pc/usbuhci.c index 00db8d7bc..e5d599c21 100644 --- a/sys/src/9/pc/usbuhci.c +++ b/sys/src/9/pc/usbuhci.c @@ -2137,10 +2137,6 @@ scanpci(void) print("usbuhci: port %#ux in use\n", io); continue; } - if(p->intl == 0xFF || p->intl == 0){ - print("usbuhci: no irq assigned for port %#ux\n", io); - continue; - } dprint("uhci: %#x %#x: port %#ux size %#x irq %d\n", p->vid, p->did, io, p->mem[4].size, p->intl);