Re: User mode drivers: part 1, interrupt handling (patch for 2.6.11)

From: Zwane Mwaikambo
Date: Sat Mar 12 2005 - 12:15:39 EST


On Sat, 12 Mar 2005, Jon Smirl wrote:

> On Fri, 11 Mar 2005 14:36:10 +1100, Peter Chubb
> <peterc@xxxxxxxxxxxxxxxxxx> wrote:
> >
> > As many of you will be aware, we've been working on infrastructure for
> > user-mode PCI and other drivers. The first step is to be able to
> > handle interrupts from user space. Subsequent patches add
> > infrastructure for setting up DMA for PCI devices.
>
> I've tried implementing this before and could not get around the
> interrupt problem. Most interrupts on the x86 architecture are shared.
> Disabling the IRQ at the PIC blocks all of the shared IRQs. This works
> (hope your userspace handler is last on the shared handler list) until
> you have a problem in userspace.
>
> Once you have a problem in userspace there is no way to acknowledge
> the interrupt anymore. I tried to address that by maintaining a timer
> and suspending the hardware through the D0 state to reset it. That had
> some success. Not acknowledging the interrupt results in an interrupt
> loop and reboot.
>
> The problem can be mitigated by choosing what slot your hardware to
> put your hardware in. This can reduce the number of shared interrupts.
> If you can get exclusive use of the interrupt this method will work.
>
> If I were designing a new bus I would make interrupt acknowledge part
> of PCI config space in order to allow a single piece of code to
> acknowledge them. Since we can't change the bus the only safe way to
> do this is to build a hardware specific driver for each device to
> acknowledge the interrupt.
>
> Bottom line is that I could find no reliable solution for handing
> interrupts.

Alan's proposal sounds very plausible and additionally if we find that
we have an irq line screaming we could use the same supplied information
to disable userspace interrupt handled devices first.

Zwane

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