# RE: \[PATCH v2\] genirq: add IRQF\_NO\_AUTOEN for request\_irq

- From: Song Bao Hua (Barry Song) \<hidden\>
- Date: 2021-01-07 20:41:11 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2021/01/6227087
- Thread: https://ratatoskr.run/linux-input/2021/01/6223761/t.md

```text


> -----Original Message-----
> From: Greg KH [mailto:gregkh@linuxfoundation.org]
> Sent: Friday, January 8, 2021 7:58 AM
> To: Song Bao Hua (Barry Song) <redacted>
> Cc: <redacted>; maz@kernel.org; <redacted>;
> linux-kernel@vger.kernel.org; linuxarm@openeuler.org; Dmitry Torokhov
> [ref]
> Subject: Re: [PATCH v2] genirq: add IRQF_NO_AUTOEN for request_irq
> 
> On Tue, Jan 05, 2021 at 03:14:11PM +1300, Barry Song wrote:
> > Many drivers don't want interrupts enabled automatically due to
> > request_irq(). So they are handling this issue by either way of
> > the below two:
> > (1)
> > irq_set_status_flags(irq, IRQ_NOAUTOEN);
> > request_irq(dev, irq...);
> > (2)
> > request_irq(dev, irq...);
> > disable_irq(irq);
> >
> > The code in the second way is silly and unsafe. In the small time
> > gap between request_irq() and disable_irq(), interrupts can still
> > come.
> > The code in the first way is safe though we might be able to do it
> > in the generic irq code.
> >
> > With this patch, drivers can request_irq with IRQF_NO_AUTOEN flag.
> > They will need neither irq_set_status_flags() nor disable_irq().
> > Hundreds of drivers with this problem will be handled afterwards.
> >
> > Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > Signed-off-by: Barry Song <redacted>
> 
> Can you also convert some in-kernel drivers to this new api so that we
> can see how this works?

Sure. As the discussion got started from input, so I'll take some
input drivers as examples before moving to other folders.

> 
> thanks,
> 
> greg k-h

Thanks
Barry

```
