[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200902271518.58246.david-b@pacbell.net>
Date: Fri, 27 Feb 2009 15:18:57 -0800
From: David Brownell <david-b@...bell.net>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: me@...ipebalbi.com, linux-kernel@...r.kernel.org,
linux-input@...r.kernel.org, felipe.balbi@...ia.com,
dmitry.torokhov@...il.com, sameo@...nedhand.com,
a.p.zijlstra@...llo.nl, tglx@...utronix.de
Subject: Re: lockdep and threaded IRQs (was: ...)
On Friday 27 February 2009, Andrew Morton wrote:
>
> > 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.)
> > 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-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists