Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23613
b: refs/heads/master
c: f516342
h: refs/heads/master
i:
  23611: dda828c
v: v3
  • Loading branch information
Dimitri Sivanich authored and Linus Torvalds committed Mar 25, 2006
1 parent 9ea933d commit 3879099
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 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: 6cc6b1226b71132a1d6e95449d78e051f1f3b506
refs/heads/master: f5163427453bc6ca2dd497eeb3e7a30d1c74b487
23 changes: 18 additions & 5 deletions trunk/kernel/irq/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,14 @@ int setup_irq(unsigned int irq, struct irqaction * new)
p = &desc->action;
if ((old = *p) != NULL) {
/* Can't share interrupts unless both agree to */
if (!(old->flags & new->flags & SA_SHIRQ)) {
spin_unlock_irqrestore(&desc->lock,flags);
return -EBUSY;
}
if (!(old->flags & new->flags & SA_SHIRQ))
goto mismatch;

#if defined(ARCH_HAS_IRQ_PER_CPU) && defined(SA_PERCPU_IRQ)
/* All handlers must agree on per-cpuness */
if ((old->flags & IRQ_PER_CPU) != (new->flags & IRQ_PER_CPU))
goto mismatch;
#endif

/* add new interrupt at end of irq queue */
do {
Expand All @@ -218,7 +222,10 @@ int setup_irq(unsigned int irq, struct irqaction * new)
}

*p = new;

#if defined(ARCH_HAS_IRQ_PER_CPU) && defined(SA_PERCPU_IRQ)
if (new->flags & SA_PERCPU_IRQ)
desc->status |= IRQ_PER_CPU;
#endif
if (!shared) {
desc->depth = 0;
desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT |
Expand All @@ -236,6 +243,12 @@ int setup_irq(unsigned int irq, struct irqaction * new)
register_handler_proc(irq, new);

return 0;

mismatch:
spin_unlock_irqrestore(&desc->lock, flags);
printk(KERN_ERR "%s: irq handler mismatch\n", __FUNCTION__);
dump_stack();
return -EBUSY;
}

/**
Expand Down

0 comments on commit 3879099

Please sign in to comment.