aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-02-23 18:52:16 -0500
committerThomas Gleixner <tglx@linutronix.de>2011-02-25 14:24:21 -0500
commit9d591edd02a245305b1b9379e4c5571bad4d2774 (patch)
tree1fdd608db6096afaf2696ff9878cb4b7096047f3
parentb5faba21a6805c33b40e258d36f57997ee1de131 (diff)
genirq: Allow shared oneshot interrupts
Support ONESHOT on shared interrupts, if all drivers agree on it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <20110223234956.483640430@linutronix.de>
-rw-r--r--kernel/irq/manage.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 2301de19ac7d..58c861367300 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -824,10 +824,6 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
824 rand_initialize_irq(irq); 824 rand_initialize_irq(irq);
825 } 825 }
826 826
827 /* Oneshot interrupts are not allowed with shared */
828 if ((new->flags & IRQF_ONESHOT) && (new->flags & IRQF_SHARED))
829 return -EINVAL;
830
831 /* 827 /*
832 * Check whether the interrupt nests into another interrupt 828 * Check whether the interrupt nests into another interrupt
833 * thread. 829 * thread.
@@ -881,10 +877,12 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
881 * Can't share interrupts unless both agree to and are 877 * Can't share interrupts unless both agree to and are
882 * the same type (level, edge, polarity). So both flag 878 * the same type (level, edge, polarity). So both flag
883 * fields must have IRQF_SHARED set and the bits which 879 * fields must have IRQF_SHARED set and the bits which
884 * set the trigger type must match. 880 * set the trigger type must match. Also all must
881 * agree on ONESHOT.
885 */ 882 */
886 if (!((old->flags & new->flags) & IRQF_SHARED) || 883 if (!((old->flags & new->flags) & IRQF_SHARED) ||
887 ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK)) { 884 ((old->flags ^ new->flags) & IRQF_TRIGGER_MASK) ||
885 ((old->flags ^ new->flags) & IRQF_ONESHOT)) {
888 old_name = old->name; 886 old_name = old->name;
889 goto mismatch; 887 goto mismatch;
890 } 888 }