[PATCH -rt] genirq: IRQF_NODELAY must be consistent between shared irqs

From: Yong Zhang
Date: Mon Jan 17 2011 - 09:33:53 EST


IRQF_NODELAY can not be messed up for shared irqs, because if
one of the regestered irq can be threaded, irq_desc->status will
set with IRQ_ONESHOT. Thus when irq is triggered, the
none-threaded one will warn with warn_no_thread().

So let __setup_irq fail if IRQF_NODELAY is not consistent between
them.

Signed-off-by: Yong Zhang <yong.zhang0@xxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
kernel/irq/manage.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index cda70cb..7ce9050 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -797,10 +797,11 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
* Can't share interrupts unless both agree to and are
* the same type (level, edge, polarity). So both flag
* fields must have IRQF_SHARED set and the bits which
- * set the trigger type must match.
+ * set the trigger type and IRQF_NODELAY must match.
*/
if (!((old->flags & new->flags) & IRQF_SHARED) ||
- ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK)) {
+ ((old->flags ^ new->flags) & (IRQF_TRIGGER_MASK |
+ IRQF_NODELAY))) {
old_name = old->name;
goto mismatch;
}
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/