aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2008-12-01 14:31:37 -0800
committerIngo Molnar <mingo@elte.hu>2008-12-02 11:25:29 +0100
commit470c66239ef0336429b35345f3f615d47341e13b (patch)
tree8816b081041daa9b5f8332b0c803678cbbd04e1f /kernel/irq/manage.c
parent7807fafa52b990abb321f1212416c71e64523ecb (diff)
downloadkernel_samsung_crespo-470c66239ef0336429b35345f3f615d47341e13b.zip
kernel_samsung_crespo-470c66239ef0336429b35345f3f615d47341e13b.tar.gz
kernel_samsung_crespo-470c66239ef0336429b35345f3f615d47341e13b.tar.bz2
genirq: warn when IRQF_DISABLED may be ignored
Impact: emit new warning We periodically waste time tracking down problems from the genirq framework not respecting IRQF_DISABLED for some shared IRQ cases. Linus views this as "will not fix", but we're still left with the bugs caused by this misbehavior. This patch adds a nag message in request_irq(), so that drivers can fix their IRQ handlers to avoid this problem. Note that developers will never see the relevant bugs when they run with LOCKDEP, so it's no wonder these bugs are hard to find. (That also means LOCKDEP is overlooking some IRQ-related bugs involving IRQ handlers that don't set IRQF_DISABLED...) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index c498a1b..7fd891c 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -635,6 +635,18 @@ int request_irq(unsigned int irq, irq_handler_t handler,
struct irq_desc *desc;
int retval;
+ /*
+ * handle_IRQ_event() always ignores IRQF_DISABLED except for
+ * the _first_ irqaction (sigh). That can cause oopsing, but
+ * the behavior is classified as "will not fix" so we need to
+ * start nudging drivers away from using that idiom.
+ */
+ if ((irqflags & (IRQF_SHARED|IRQF_DISABLED))
+ == (IRQF_SHARED|IRQF_DISABLED))
+ pr_warning("IRQ %d/%s: IRQF_DISABLED is not "
+ "guaranteed on shared IRQs\n",
+ irq, devname);
+
#ifdef CONFIG_LOCKDEP
/*
* Lockdep wants atomic interrupt handlers: