Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31079
b: refs/heads/master
c: e76de9f
h: refs/heads/master
i:
  31077: bfeab0d
  31075: 682a13d
  31071: a0e6c8f
v: v3
  • Loading branch information
Thomas Gleixner authored and Linus Torvalds committed Jun 29, 2006
1 parent 5c3171a commit e468bb6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ba9a2331bae5da8f65be3722b9e2d210f1987857
refs/heads/master: e76de9f8eb67b7acc1cc6f28c4be8583adf0a90c
31 changes: 27 additions & 4 deletions trunk/kernel/irq/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,14 @@ int setup_irq(unsigned int irq, struct irqaction *new)
p = &desc->action;
old = *p;
if (old) {
/* Can't share interrupts unless both agree to */
if (!(old->flags & new->flags & SA_SHIRQ))
/*
* Can't share interrupts unless both agree to and are
* the same type (level, edge, polarity). So both flag
* fields must have SA_SHIRQ set and the bits which
* set the trigger type must match.
*/
if (!((old->flags & new->flags) & SA_SHIRQ) ||
((old->flags ^ new->flags) & SA_TRIGGER_MASK))
goto mismatch;

#if defined(CONFIG_IRQ_PER_CPU) && defined(SA_PERCPU_IRQ)
Expand All @@ -250,7 +256,22 @@ int setup_irq(unsigned int irq, struct irqaction *new)
#endif
if (!shared) {
irq_chip_set_defaults(desc->chip);
compat_irq_chip_set_default_handler(desc);

/* Setup the type (level, edge polarity) if configured: */
if (new->flags & SA_TRIGGER_MASK) {
if (desc->chip && desc->chip->set_type)
desc->chip->set_type(irq,
new->flags & SA_TRIGGER_MASK);
else
/*
* SA_TRIGGER_* but the PIC does not support
* multiple flow-types?
*/
printk(KERN_WARNING "setup_irq(%d) SA_TRIGGER"
"set. No set_type function available\n",
irq);
} else
compat_irq_chip_set_default_handler(desc);

desc->status &= ~(IRQ_AUTODETECT | IRQ_WAITING |
IRQ_INPROGRESS);
Expand All @@ -262,7 +283,9 @@ int setup_irq(unsigned int irq, struct irqaction *new)
desc->chip->startup(irq);
else
desc->chip->enable(irq);
}
} else
/* Undo nested disables: */
desc->depth = 1;
}
spin_unlock_irqrestore(&desc->lock, flags);

Expand Down

0 comments on commit e468bb6

Please sign in to comment.