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

From: Dmitry Torokhov
Date: Sat Aug 15 2009 - 15:43:13 EST


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()?

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.

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