static void i8259_end_irq(unsigned int irq)
{
- if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+ if (!(irq_desc[irq].status & (IRQ_DISABLED|IRQ_INPROGRESS))
+ && irq_desc[irq].action)
i8259_unmask_irq(irq);
}
* use the action we have.
*/
action = NULL;
- if (!(status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
+ if (likely(!(status & (IRQ_DISABLED | IRQ_INPROGRESS)))) {
action = desc->action;
if (!action || !action->handler) {
ppc_spurious_interrupts++;
a different instance of this same irq, the other processor
will take care of it.
*/
- if (!action)
+ if (unlikely(!action))
goto out;
handle_irq_event(irq, regs, action);
spin_lock(&desc->lock);
- if (!(desc->status & IRQ_PENDING))
+ if (likely(!(desc->status & IRQ_PENDING)))
break;
desc->status &= ~IRQ_PENDING;
}
- desc->status &= ~IRQ_INPROGRESS;
out:
+ desc->status &= ~IRQ_INPROGRESS;
/*
* The ->end() handler has to deal with interrupts which got
* disabled while the handler was running.
#ifdef CONFIG_SMP
void synchronize_irq(unsigned int irq)
{
- /* is there anything to synchronize with? */
- if (!irq_desc[irq].action)
- return;
-
while (irq_desc[irq].status & IRQ_INPROGRESS)
barrier();
}
#include <asm/sections.h>
#include <asm/open_pic.h>
#include <asm/i8259.h>
+#include <asm/hardirq.h>
#include "open_pic_defs.h"
static void openpic_end_irq(unsigned int irq_nr)
{
- if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS)))
+ if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
+ && irq_desc[irq_nr].action)
openpic_enable_irq(irq_nr);
}
}
}
- if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
+ if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))
+ && irq_desc[irq].action) {
ppc_cached_irq_mask[word] |= 1 << (31 - bit);
switch (word){
case 0:
int bit, word;
volatile uint *simr;
- if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))) {
+ if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
+ && irq_desc[irq_nr].action) {
bit = irq_to_siubit[irq_nr];
word = irq_to_siureg[irq_nr];
static void m8xx_end_irq(unsigned int irq_nr)
{
- if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))) {
+ if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
+ && irq_desc[irq_nr].action) {
int bit, word;
bit = irq_nr & 0x1f;
static void __pmac pmac_end_irq(unsigned int irq_nr)
{
- if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))) {
+ if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
+ && irq_desc[irq_nr].action) {
set_bit(irq_nr, ppc_cached_irq_mask);
pmac_set_irq_mask(irq_nr, 1);
}