[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADtm3G4LRyojo+kX=neOsVYVX9_aY66yj-9XuFrjvrQcZJJYxg@mail.gmail.com>
Date: Thu, 11 May 2017 16:21:23 -0700
From: Gregory Fong <gregory.0xf0@...il.com>
To: tglx@...utronix.de
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linux@...linux.org.uk, Florian Fainelli <f.fainelli@...il.com>
Subject: handle_bad_irq and locking
Hi Thomas,
I noticed that when you changed arm irq handling to use the generic
implementation back in 2006 that you changed do_bad_IRQ() to the
following:
+#define do_bad_IRQ(irq,desc,regs) \
+do { \
+ spin_lock(&desc->lock); \
+ handle_bad_irq(irq, desc, regs); \
+ spin_unlock(&desc->lock); \
+} while(0)
and it's mostly stayed the same since then. As such, there are a few
examples of this being open-coded in the kernel in various irqchip
handlers such as that of drivers/irqchip/irq-brcmstb-l2.c, and even
more cases where the lock isn't being grabbed before calling
handle_bad_irq().
Since handle_bad_irq() is sort of a flow handler like
handle_edge_irq() etc., do you think it would make sense to do the
same as those and have it do the locking on its own? A quick look
through existing users of handle_bad_irq() at [1] suggests that either
the locking isn't necessary or it's almost always done wrong.
Apologies if this has been asked before, but it's remarkably difficult
to search for.
[1] http://elixir.free-electrons.com/linux/latest/ident/handle_bad_irq
Thanks and regards,
Gregory
Powered by blists - more mailing lists