From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [RESEND PATCH] genirq: warn about IRQF_SHARED|IRQF_DISABLED at the right place
Date: Tue, 12 Jan 2010 16:42:02 +0100 [thread overview]
Message-ID: <1263310922-5251-1-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <1259578067-29169-1-git-send-email-u.kleine-koenig@pengutronix.de>
For shared irqs IRQF_DISABLED is only guaranteed for the first handler.
So only warn starting at the second registration.
The warning is moved to __setup_irq having the additional benefit of
catching actions registered using setup_irq not only register_irq.
This doesn't fix the cases where setup order is wrong but it should
report the broken cases more reliably.
Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Nicolas Pitre <nico@marvell.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Remy Bohmer <linux@bohmer.net>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Andrea Gallo <andrea.gallo@stericsson.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jamie Lokier <jamie@shareable.org>
Cc: linux-arm-kernel at lists.infradead.org
---
Hello,
until Thomas or Peter get round to dump IRQF_DISABLED completely this
patch removes some false positive warnings and adds a valid warning in
some situations that weren't catched before.
Best regards
Uwe
kernel/irq/manage.c | 23 ++++++++++-------------
1 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index bde4c66..d8f7415 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -702,6 +702,16 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
goto mismatch;
#endif
+ /*
+ * handle_IRQ_event() only honors IRQF_DISABLED for the _first_
+ * irqaction. As the first handler might reenable irqs all bets
+ * are off for the later handlers even if the first one has
+ * IRQF_DISABLED, too.
+ */
+ if (new->flags & IRQF_DISABLED)
+ pr_warning("IRQ %d/%s: IRQF_DISABLED is not guaranteed "
+ "on shared IRQs\n", irq, new->name);
+
/* add new interrupt at end of irq queue */
do {
old_ptr = &old->next;
@@ -1008,19 +1018,6 @@ int request_threaded_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:
--
1.6.6
next prev parent reply other threads:[~2010-01-12 15:42 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-21 7:39 [PATCH] Don't disable irqs in set_next_event and set_mode callbacks Uwe Kleine-König
2009-09-21 9:04 ` Russell King - ARM Linux
2009-09-21 9:16 ` Uwe Kleine-König
2009-09-21 9:30 ` Russell King - ARM Linux
2009-09-21 10:48 ` Alessandro Rubini
2009-09-21 12:32 ` Kristoffer Ericson
2009-09-23 19:01 ` Eric Miao
2009-09-23 21:04 ` Remy Bohmer
2009-11-26 10:26 ` [RESENT PATCH] " Uwe Kleine-König
2009-11-26 10:50 ` Russell King - ARM Linux
2009-11-26 11:31 ` Russell King - ARM Linux
2009-11-27 10:44 ` Uwe Kleine-König
2009-11-27 19:08 ` Thomas Gleixner
2009-11-27 19:58 ` Russell King - ARM Linux
2009-11-27 20:38 ` Uwe Kleine-König
2009-11-27 20:44 ` Russell King - ARM Linux
2009-11-27 21:31 ` Thomas Gleixner
2009-11-27 21:59 ` Russell King - ARM Linux
2009-11-27 22:20 ` Thomas Gleixner
2009-11-27 21:10 ` [PATCH] warn about shared irqs requesting IRQF_DISABLED registered with setup_irq Uwe Kleine-König
2009-11-27 22:18 ` Thomas Gleixner
2009-11-28 20:03 ` Uwe Kleine-König
2009-11-28 21:50 ` Thomas Gleixner
2009-11-28 22:13 ` David Brownell
2009-11-29 2:31 ` Jamie Lokier
2009-11-29 10:26 ` Uwe Kleine-König
2009-11-29 15:18 ` Jamie Lokier
2009-11-29 15:27 ` Russell King - ARM Linux
2009-11-30 20:39 ` Jamie Lokier
2009-11-30 9:28 ` Uwe Kleine-König
2009-11-30 9:54 ` Thomas Gleixner
2009-11-28 22:09 ` David Brownell
2009-11-30 10:47 ` [PATCH] genirq: warn about IRQF_SHARED|IRQF_DISABLED at the right place Uwe Kleine-König
2009-11-30 13:54 ` Get rid of IRQF_DISABLED - (was [PATCH] genirq: warn about IRQF_SHARED|IRQF_DISABLED) Thomas Gleixner
2009-11-30 14:03 ` Peter Zijlstra
2009-11-30 14:24 ` Thomas Gleixner
2009-11-30 14:47 ` Alan Cox
2009-11-30 15:01 ` Russell King - ARM Linux
2009-11-30 15:32 ` Alan Cox
2009-11-30 15:43 ` Russell King - ARM Linux
2009-11-30 20:15 ` Andrew Victor
2009-11-30 20:53 ` David Brownell
2009-11-30 20:38 ` David Brownell
2009-12-01 1:42 ` Andy Walls
2009-11-30 19:59 ` Benjamin Herrenschmidt
2009-11-30 21:31 ` Thomas Gleixner
2009-11-30 21:42 ` Benjamin Herrenschmidt
2009-11-30 21:54 ` Thomas Gleixner
2009-11-30 14:37 ` Russell King - ARM Linux
2009-11-30 14:39 ` Russell King - ARM Linux
2009-11-30 17:48 ` Thomas Gleixner
2009-11-30 14:51 ` Alan Cox
2009-11-30 21:59 ` Thomas Gleixner
2009-11-30 23:30 ` Alan Cox
2009-11-30 15:38 ` Nicolas Pitre
2009-11-30 17:46 ` Thomas Gleixner
2009-11-30 19:51 ` Uwe Kleine-König
2009-11-30 21:23 ` Thomas Gleixner
2009-11-30 20:21 ` [PATCH] genirq: warn about IRQF_SHARED|IRQF_DISABLED at the right place David Brownell
2009-11-30 20:27 ` Uwe Kleine-König
2010-01-12 15:42 ` Uwe Kleine-König [this message]
2009-11-26 10:51 ` [RESENT PATCH] Don't disable irqs in set_next_event and set_mode callbacks Eric Miao
2009-12-17 13:33 ` [PATCH 1/2] arm/at91: " Uwe Kleine-König
2009-12-17 13:33 ` [PATCH 2/2] arm/{pxa, sa1100, nomadik}: Don't disable irqs in set_next_event and set_mode Uwe Kleine-König
2010-01-22 16:08 ` [PATCH 1/2] arm/at91: Don't disable irqs in set_next_event and set_mode callbacks Uwe Kleine-König
2010-01-22 16:36 ` Russell King - ARM Linux
2010-01-22 16:52 ` Uwe Kleine-König
2010-02-12 10:35 ` Uwe Kleine-König
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=1263310922-5251-1-git-send-email-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).