> On Mon, Feb 20, 2012 at 12:07:27PM +0000, Arnd Bergmann wrote:
>
> > Also, I would recommend using request_irq instead of
> > request_threaded_irq here because the function only has a single
> > "complete()" call in it, just like a threaded IRQ handler has. There
> > is no point going through another thread just to wake up the one that is blocked.
>
> Actually in this case that won't work as the interrupt is generated by the chip interrupt controller and as the chip is I2C/SPI controlled it is itself threaded and can only generate threaded interrupts as genirq can't get back into hard interrupt context.
>
> As a result of this restriction when an interrupt handler doesn't care what context it runs in it's better to use request_any_context_irq().
> This will do a normal IRQ when it can but will bind successfully to a threaded IRQ if that's what's provided.
as threaded IRQs are only being used, request_any_context_irq() will
internally call request_threaded_irq() so is there any other need to
replace the current request_threaded_irq()?
On Tuesday 21 February 2012, Ashish Jangam wrote:
> > On Mon, Feb 20, 2012 at 12:07:27PM +0000, Arnd Bergmann wrote:
> >
> > > Also, I would recommend using request_irq instead of
> > > request_threaded_irq here because the function only has a single
> > > "complete()" call in it, just like a threaded IRQ handler has. There
> > > is no point going through another thread just to wake up the one that is blocked.
> >
> > Actually in this case that won't work as the interrupt is generated by the chip interrupt controller and as the chip is I2C/SPI controlled it is itself threaded and can only generate threaded interrupts as genirq can't get back into hard interrupt context.
> >
> > As a result of this restriction when an interrupt handler doesn't care what context it runs in it's better to use request_any_context_irq().
> > This will do a normal IRQ when it can but will bind successfully to a threaded IRQ if that's what's provided.
>
> as threaded IRQs are only being used, request_any_context_irq() will
> internally call request_threaded_irq() so is there any other need to
> replace the current request_threaded_irq()?
No, it's certainly ok to keep using request_threaded_irq, my suggestion was
only in order to improve performance, which it will not do as Mark commented.
I don't any strong reason one way or another.
Arnd