Re: lockdep and threaded IRQs (was: ...)

From
David Brownell <hidden>
Date
2009-02-27 23:19:18
Also in
lkml
Reply to
Andrew Morton, 2009-02-27
On Friday 27 February 2009, Andrew Morton wrote:
quoted
There are actually two issues.  The lockdep issue is
one ... the above #ifdef suffices to work around it
for all the TWL4030 (family) IRQs.
(And other similar cases, of course, including those
MMC cases that crap out in the ARM memory management
code when lockdep wrongly disables IRQs.)

quoted
The other is that Linux needs real support for threaded
interrupts.  Almost every I2C (or SPI) device that raises
an IRQ needs its IRQ handler to run in a thread, and most
of them have the same type of workqueue-based hack to
get such a thread.  (Some others have bugs instead...)

Obviously, if any threaded IRQ handler grabs a mutex,
but lockdep has disabled IRQs, trouble ensues...
What's going on here?  hardirq handlers cannot take mutexes and cannot
sleep, period.  
But these handlers are *NOT* running in hardirq context;
so such thought doesn't apply.  The hardirq bit of the
IRQ-handling activity completed quite a bit earlier.

Being able to sleep and grab mutexes is one of the main
reasons for wanting threaded IRQ handlers.  For common
(embedded) I2C hardware, if threaded IRQ handlers can't
sleep they're completely useless.

And something that may eventually matter for mainline:
in RT contexts, thread priority applies to mutex grabbing,
and helps manage priority inversion.  That's equivalent
to sleeping.

This stuff just pokes at some annoying current gaps in the
IRQ framework.  I'll be glad when eventually there's no
need to work around those weaknesses ... that is, when
real threaded IRQ support is available.

Enabling local interrupts might shut up some warning, 
but won't fix the deadlocks which that warning is there to warn us
about.
Wrong; all such warnings are false, in these cases.

- Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Thread (96 messages) 96 messages, 12 authors, last reply 2009-07-22
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help