Re: Shared interrupt (lack of) handling

Paul Ashton (lk@mailandnews.com)
Thu, 02 Sep 1999 18:18:01 +0100


alan@lxorguk.ukuu.org.uk said:
> > process every interrupt without determining whether it really is
> > a USB one or not. In an attempt to fix it I searched many other
> > drivers and couldn't find many that do.
>
> Most do. The ethernet drivers for example tend to be
>
> while((status=inw(somwhere))!=0)
> {
> blah
> }
>
> which has the desired effect

Ok, I can see that, but it doesn't seem to be done in abundance.

Wouldn't it be clearer if request_irq() took a function pointer
to be used to determine whether the interrupt belongs to the
driver or not? i.e.:

if (request_irq(irq, intr, SA_SHIRQ, "foo", foodev, isfoointr) { ... }

static int isfoointr(int irq, void *foodev, struct pt_regs *regs) {
if (foodev && inw(FOOIO))
return 1; /* foo device generated this interrupt */
else
return 0; /* not my interrupt */
}

At least it would force driver writers to address the shared interrupt
issue, and if the kernel determines that nobody claims the interrupt
it could do something about it, like complain, which it can't do at
the moment. Something that has caused me endless problems on a laptop
with some unidentifiable PCI device generating unhandled interrupts.

Paul

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/