lkml.org 
[lkml]   [2005]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: User mode drivers: part 1, interrupt handling (patch for 2.6.11)
    From
    Date
    On Gwe, 2005-03-11 at 03:36, Peter Chubb wrote:
    > +static irqreturn_t irq_proc_irq_handler(int irq, void *vidp, struct pt_regs *regs)
    > +{
    > + struct irq_proc *idp = (struct irq_proc *)vidp;
    > +
    > + BUG_ON(idp->irq != irq);
    > + disable_irq_nosync(irq);
    > + atomic_inc(&idp->count);
    > + wake_up(&idp->q);
    > + return IRQ_HANDLED;

    You just deadlocked the machine in many configurations. You can't use
    disable_irq for this trick you have to tell the kernel how to handle it.
    I posted a proposal for this sometime ago because X has some uses for
    it. The idea being you'd pass a struct that describes

    1. What tells you an IRQ occurred on this device
    2. How to clear it
    3. How to enable/disable it.

    Something like

    struct {
    u8 type; /* 8, 16, 32 I/O or MMIO */
    u8 bar; /* PCI bar to use */
    u32 offset; /* Into bar */
    u32 mask; /* Bits to touch/compare */
    u32 value; /* Value to check against/set */
    }


    -
    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/

    \
     
     \ /
      Last update: 2005-03-22 14:11    [W:0.023 / U:60.704 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site