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

From: Jon Smirl (jonsmirl_at_gmail.com)
Date: 03/12/05

  • Next message: Guido Villa: "Error with Sil3112A SATA controller and Maxtor 300GB HDD"
    Date:	Sat, 12 Mar 2005 10:55:21 -0500
    To: Peter Chubb <peterc@gelato.unsw.edu.au>
    
    

    On Fri, 11 Mar 2005 14:36:10 +1100, Peter Chubb
    <peterc@gelato.unsw.edu.au> 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.

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

  • Next message: Guido Villa: "Error with Sil3112A SATA controller and Maxtor 300GB HDD"

    Relevant Pages

    • Re: Polling loop good here???
      ... The "vertical retrace interrupt" was IRQ 2... ... In today's hardware - as has been mentioned - they've almost certainly ... it...make use of the drivers... ...
      (alt.lang.asm)
    • Re: can someone explain...[ PCI interrupts]
      ... interrupts for PCI devices are roughly split up into two categories: INTx interrupt lines and MSI interrupts. ... Each processor contains a local APIC that can receive messages from other APICs and send messages to other local APICs. ... Basically, an IRQ value is a cookie useful for binding a device interrupt tuple or an ISA IRQ) to a x86 interrupt tuple. ...
      (freebsd-current)
    • Re: x86, shared IRQ. how to track down the culprit?
      ... IRQ20 is being shared by drivers with different interrupt levels. ... The vector value is the IRQ assigned, and you will probably find two entries ... It means the BIOS has assigned two PCI devices the same IRQ ...
      (comp.unix.solaris)
    • Re: pcmcia oops on 2.6.17-rc[12]
      ... requesting an interrupt, and getting: ... indication of a hardware configuration error. ... PCMCIA IRQs ... Drivers that ask for an exclusive PCMCIA IRQ ...
      (Linux-Kernel)
    • 2.6.17-rc3 "Bus #03 (-#06) is hidden behind transparent bridge"
      ... PCI: PCI BIOS revision 2.10 entry at 0xf031f, ... ACPI: Interpreter enabled ... Using PIC for interrupt routing ... Using APIC driver default ...
      (Linux-Kernel)