Skip to content

Commit

Permalink
genirq: irq_chip->startup() usage in setup_irq and set_irq_chained ha…
Browse files Browse the repository at this point in the history
…ndler

This patch clarifies usage of irq_chip->startup() callback:

1. The "if (startup) startup(); else enabled();" code in setup_irq()
   is unnecessary, as startup() falls back to enabled() via
   default callbacks, set by irq_chip_set_defaults().

2. When using set_irq_chained_handler() the startup() was never called,
   which is not good at all... Fixed. And again - when startup() is not
   defined the call will fall back to enable() than to unmask() via
   default callbacks.

Signed-off-by: Pawel Moll <pawel.moll@st.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Pawel MOLL authored and Ingo Molnar committed Sep 6, 2008
1 parent 377bf1e commit 7e6e178
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion kernel/irq/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
desc->status &= ~IRQ_DISABLED;
desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE;
desc->depth = 0;
desc->chip->unmask(irq);
desc->chip->startup(irq);
}
spin_unlock_irqrestore(&desc->lock, flags);
}
Expand Down
5 changes: 1 addition & 4 deletions kernel/irq/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,7 @@ int setup_irq(unsigned int irq, struct irqaction *new)
if (!(desc->status & IRQ_NOAUTOEN)) {
desc->depth = 0;
desc->status &= ~IRQ_DISABLED;
if (desc->chip->startup)
desc->chip->startup(irq);
else
desc->chip->enable(irq);
desc->chip->startup(irq);
} else
/* Undo nested disables: */
desc->depth = 1;
Expand Down

0 comments on commit 7e6e178

Please sign in to comment.