[<prev] [next>] [day] [month] [year] [list]
Message-Id: <200810271348.53492.david-b@pacbell.net>
Date: Mon, 27 Oct 2008 13:48:53 -0700
From: David Brownell <david-b@...bell.net>
To: lkml <linux-kernel@...r.kernel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>
Subject: [patch/RESEND 2.6.28-rc2] genirq: warn when IRQF_DISABLED may be ignored
From: David Brownell <dbrownell@...rs.sourceforge.net>
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@...rs.sourceforge.net>
---
kernel/irq/manage.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -635,6 +635,18 @@ int request_irq(unsigned int irq, irq_ha
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:
--
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