[patch 03/26] powerpc: eeh: Kill another abuse of irq_desc
tglx at linutronix.de
Mon Feb 24 22:32:46 EST 2014
On Mon, 24 Feb 2014, Gavin Shan wrote:
> On Sun, Feb 23, 2014 at 09:40:09PM -0000, Thomas Gleixner wrote:
> >commit 91150af3a (powerpc/eeh: Fix unbalanced enable for IRQ) is
> >another brilliant example of trainwreck engineering.
> >The patch "fixes" the issue of an unbalanced call to irq_enable()
> >which causes a prominent warning by checking the disabled state of the
> >interrupt line and call conditionally into the core code.
> >This is wrong in two aspects:
> >1) The warning is there to tell users, that they need to fix their
> > asymetric enable/disable patterns by finding the root cause and
> > solving it there.
> > It's definitely not meant to work around it by conditionally
> > calling into the core code depending on the random state of the irq
> > line.
> > Asymetric irq_disable/enable calls are a clear sign of wrong usage
> > of the interfaces which have to be cured at the root and not by
> > somehow hacking around it.
> >2) The abuse of core internal data structure instead of using the
> > proper interfaces for retrieving the information for the 'hack
> > around'
> > irq_desc is core internal and it's clear enough stated.
> >Replace at least the irq_desc abuse with the proper functions and add
> >a big fat comment why this is absurd and completely wrong.
> Thanks for pointing it out. I think we might have this patch for now
> and I'll look into individual drivers to fix the unbalanced function
> calls later one by one.
Fine with me. You wont escape my scan scripts :)
More information about the Linuxppc-dev