From: David Brownell <david-b@pacbell.net>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Subject: [patch 2.6.27-r1] irq: warn about (IRQF_DISABLED|IRQF_SHARED)
Date: Tue, 29 Jul 2008 13:00:19 -0700 [thread overview]
Message-ID: <200807291300.20094.david-b@pacbell.net> (raw)
From: David Brownell <dbrownell@users.sourceforge.net>
We periodically waste time tracking down problems caused by the IRQ
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>
---
This was the root cause of some USB oopsing a while back ...
kernel/irq/manage.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
--- a/kernel/irq/manage.c 2008-07-26 17:40:47.000000000 -0700
+++ b/kernel/irq/manage.c 2008-07-26 17:40:50.000000000 -0700
@@ -597,6 +597,18 @@ int request_irq(unsigned int irq, irq_ha
struct irqaction *action;
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:
reply other threads:[~2008-07-29 20:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200807291300.20094.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox