Re: [PATCH] genirq: Check irq disabled & masked states in irq_shutdown
From: Thomas Gleixner
Date: Wed May 31 2017 - 05:22:21 EST
On Tue, 30 May 2017, Brian Norris wrote:
> On Sat, May 27, 2017 at 10:16:37AM +0200, Thomas Gleixner wrote:
> > On Sat, 27 May 2017, jeffy wrote:
> > > for example when a driver(drivers/net/wireless/marvell/mwifiex/main.c) try to
> > > do these:
> > >
> > > devm_request_irq->irq_startup->irq_enable
> > > disable_irq <-- disabled and masked
> > > devm_free_irq->irq_shutdown <-- disable it again
> >
> > This driver is broken as hell.
>
> No argument on the general statement :)
>
> > It requests the interrupt _BEFORE_ the whole
> > thing is initialized. If there is a pending interrupt on that line, it will
> > explode nicely before it is able to disable the irq. But that's a different
> > problem.
>
> For that particular interrupt, it's mostly an informational interrupt
> regarding wakeups. We don't do anything that could blow up there, except
> report a (spurious) wakeup event. (And this spurious wakeup event only
> occurs because the Wifi firmware may toggle its "wake" pin even when the
> system is already awake. A weird behavior...)
>
> So yes, the pattern isn't great, but no, it's not going to blow up,
> AFAIK.
Fair enough.
Thanks,
tglx