Re: [RFC patch 1/3] genirq: Add oneshot support

From: Thomas Gleixner
Date: Sat Aug 15 2009 - 16:01:39 EST


Dmitry,

On Sat, 15 Aug 2009, Dmitry Torokhov wrote:
> Hi Thomas,
>
> On Sat, Aug 15, 2009 at 05:48:33PM -0000, Thomas Gleixner wrote:
> >
> > /**
> > + * irq_oneshot_primary_handler - Handle oneshot interrupt primary handler
> > + * @irq: the interrupt number
> > + * @dev_id: cookie to identify the device
> > + *
> > + * For oneshot interrupts which keep the interrupt line masked
> > + * until the threaded handler has been executed, the only
> > + * functionality of the primary handler is to return
> > + * IRQ_WAKE_THREAD. This is the generic implementation which
> > + * avoids lots of duplicates all over the place
> > + */
> > +irqreturn_t irq_oneshot_primary_handler(int irq, void *dev_id)
> > +{
> > + return IRQ_WAKE_THREAD;
> > +}
> > +EXPORT_SYMBOL_GPL(irq_oneshot_primary_handler);
>
> This kind of handler is useful not only for users of oneshot interrupts
> but also other drivers using threaded IRQs. So maybe we should rename it
> to default_threaded_irq_handler() and instead of exporting it simply
> have it installed automatically when driver requests NULL in place of
> IRQ handler in request_threaded_irq()?

Good point. If handler == NULL and thread_fn != NULL. That's
reasonable. Will rework.

> Also, if IRQF_ONESHOT definition would make into mainline sooner than
> later that would be great - then I'd be able to put all the drivers that
> will end up using it into my next branch and not be concerned of
> breaking linux-next.

Hmm, the ONESHOT definition alone won't give you the testing you
want. If all involved folks agree on the patch series I can commit it
into a standalone branch which can be pulled into the development
branches of interested driver maintainers. Git will deal with that
just fine.

@Andrew: any opinion on that ?

Thanks,

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