Re: [PATCH v2] genirq: Check irq disabled & masked states in irq_shutdown

From: Thomas Gleixner
Date: Sat May 27 2017 - 06:51:57 EST


On Sat, 27 May 2017, jeffy wrote:
> On 05/27/2017 04:30 PM, Thomas Gleixner wrote:
> > On Sat, 27 May 2017, Jeffy Chen wrote:
> >
> > > If a irq is already disabled & masked, free_irq may cause a unbalanced
> > > irq shutdown/disable/mask, for example:
> >
> > No, it's not. irq_shutdown/disable/mask are low level access functions
> > which can be invoked at any given time.
> >
> > The only interface which has refcounting is disable/enable_irq().
> but i think it still be good trying to make them balance, at least for irq
> enable/disable :)

If we make them balanced then we do it proper and not just for the single
issue you are facing. And we do not try. We analyze it proper and fix it.

It's not rocket science, but yes it takes a bit longer than cobbling
something together which works just for you.

Thanks,

tglx