Commit 78a93c96 authored by Russell King's avatar Russell King

[ARM] Remove IRQ desc->enabled in favour of testing disable_depth

parent a04d2bdf
...@@ -78,7 +78,8 @@ static struct irqdesc bad_irq_desc = { ...@@ -78,7 +78,8 @@ static struct irqdesc bad_irq_desc = {
* disable_irq - disable an irq and wait for completion * disable_irq - disable an irq and wait for completion
* @irq: Interrupt to disable * @irq: Interrupt to disable
* *
* Disable the selected interrupt line. We do this lazily. * Disable the selected interrupt line. Enables and disables
* are nested. We do this lazily.
* *
* This function may be called from IRQ context. * This function may be called from IRQ context.
*/ */
...@@ -88,8 +89,7 @@ void disable_irq(unsigned int irq) ...@@ -88,8 +89,7 @@ void disable_irq(unsigned int irq)
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&irq_controller_lock, flags); spin_lock_irqsave(&irq_controller_lock, flags);
if (!desc->depth++) desc->disable_depth++;
desc->enabled = 0;
spin_unlock_irqrestore(&irq_controller_lock, flags); spin_unlock_irqrestore(&irq_controller_lock, flags);
} }
...@@ -107,24 +107,25 @@ void enable_irq(unsigned int irq) ...@@ -107,24 +107,25 @@ void enable_irq(unsigned int irq)
{ {
struct irqdesc *desc = irq_desc + irq; struct irqdesc *desc = irq_desc + irq;
unsigned long flags; unsigned long flags;
int pending = 0;
spin_lock_irqsave(&irq_controller_lock, flags); spin_lock_irqsave(&irq_controller_lock, flags);
if (unlikely(!desc->depth)) { if (unlikely(!desc->disable_depth)) {
printk("enable_irq(%u) unbalanced from %p\n", irq, printk("enable_irq(%u) unbalanced from %p\n", irq,
__builtin_return_address(0)); __builtin_return_address(0));
} else if (!--desc->depth) { } else if (!--desc->disable_depth) {
desc->probing = 0; desc->probing = 0;
desc->enabled = 1;
desc->chip->unmask(irq); desc->chip->unmask(irq);
pending = desc->pending;
desc->pending = 0;
/* /*
* If the interrupt was waiting to be processed, * If the interrupt is waiting to be processed,
* retrigger it. * try to re-run it. We can't directly run it
* from here since the caller might be in an
* interrupt-protected region.
*/ */
if (pending) if (desc->pending) {
desc->pending = 0;
desc->chip->rerun(irq); desc->chip->rerun(irq);
}
} }
spin_unlock_irqrestore(&irq_controller_lock, flags); spin_unlock_irqrestore(&irq_controller_lock, flags);
} }
...@@ -264,7 +265,7 @@ do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) ...@@ -264,7 +265,7 @@ do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
* we shouldn't process the IRQ. Instead, turn on the * we shouldn't process the IRQ. Instead, turn on the
* hardware masks. * hardware masks.
*/ */
if (unlikely(desc->running || !desc->enabled)) if (unlikely(desc->running || desc->disable_depth))
goto running; goto running;
/* /*
...@@ -286,13 +287,13 @@ do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) ...@@ -286,13 +287,13 @@ do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
if (!action) if (!action)
break; break;
if (desc->pending && desc->enabled) { if (desc->pending && !desc->disable_depth) {
desc->pending = 0; desc->pending = 0;
desc->chip->unmask(irq); desc->chip->unmask(irq);
} }
__do_irq(irq, action, regs); __do_irq(irq, action, regs);
} while (desc->pending && desc->enabled); } while (desc->pending && !desc->disable_depth);
desc->running = 0; desc->running = 0;
...@@ -328,7 +329,7 @@ do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) ...@@ -328,7 +329,7 @@ do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
*/ */
desc->chip->ack(irq); desc->chip->ack(irq);
if (likely(desc->enabled)) { if (likely(!desc->disable_depth)) {
kstat_cpu(cpu).irqs[irq]++; kstat_cpu(cpu).irqs[irq]++;
/* /*
...@@ -338,7 +339,7 @@ do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) ...@@ -338,7 +339,7 @@ do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs)
if (action) { if (action) {
__do_irq(irq, desc->action, regs); __do_irq(irq, desc->action, regs);
if (likely(desc->enabled && if (likely(!desc->disable_depth &&
!check_irq_lock(desc, irq, regs))) !check_irq_lock(desc, irq, regs)))
desc->chip->unmask(irq); desc->chip->unmask(irq);
} }
...@@ -390,14 +391,13 @@ void __set_irq_handler(unsigned int irq, irq_handler_t handle, int is_chained) ...@@ -390,14 +391,13 @@ void __set_irq_handler(unsigned int irq, irq_handler_t handle, int is_chained)
if (handle == do_bad_IRQ) { if (handle == do_bad_IRQ) {
desc->chip->mask(irq); desc->chip->mask(irq);
desc->chip->ack(irq); desc->chip->ack(irq);
desc->depth = 1; desc->disable_depth = 1;
desc->enabled = 0;
} }
desc->handle = handle; desc->handle = handle;
if (handle != do_bad_IRQ && is_chained) { if (handle != do_bad_IRQ && is_chained) {
desc->valid = 0; desc->valid = 0;
desc->probe_ok = 0; desc->probe_ok = 0;
desc->depth = 0; desc->disable_depth = 0;
desc->chip->unmask(irq); desc->chip->unmask(irq);
} }
spin_unlock_irqrestore(&irq_controller_lock, flags); spin_unlock_irqrestore(&irq_controller_lock, flags);
...@@ -512,10 +512,9 @@ int setup_irq(unsigned int irq, struct irqaction *new) ...@@ -512,10 +512,9 @@ int setup_irq(unsigned int irq, struct irqaction *new)
desc->probing = 0; desc->probing = 0;
desc->running = 0; desc->running = 0;
desc->pending = 0; desc->pending = 0;
desc->depth = 1; desc->disable_depth = 1;
if (!desc->noautoenable) { if (!desc->noautoenable) {
desc->depth = 0; desc->disable_depth = 0;
desc->enabled = 1;
desc->chip->unmask(irq); desc->chip->unmask(irq);
} }
} }
......
...@@ -50,8 +50,8 @@ struct irqdesc { ...@@ -50,8 +50,8 @@ struct irqdesc {
irq_handler_t handle; irq_handler_t handle;
struct irqchip *chip; struct irqchip *chip;
struct irqaction *action; struct irqaction *action;
unsigned int disable_depth;
unsigned int enabled : 1; /* IRQ is currently enabled */
unsigned int triggered: 1; /* IRQ has occurred */ unsigned int triggered: 1; /* IRQ has occurred */
unsigned int running : 1; /* IRQ is running */ unsigned int running : 1; /* IRQ is running */
unsigned int pending : 1; /* IRQ is pending */ unsigned int pending : 1; /* IRQ is pending */
...@@ -59,8 +59,7 @@ struct irqdesc { ...@@ -59,8 +59,7 @@ struct irqdesc {
unsigned int probe_ok : 1; /* IRQ can be used for probe */ unsigned int probe_ok : 1; /* IRQ can be used for probe */
unsigned int valid : 1; /* IRQ claimable */ unsigned int valid : 1; /* IRQ claimable */
unsigned int noautoenable : 1; /* don't automatically enable IRQ */ unsigned int noautoenable : 1; /* don't automatically enable IRQ */
unsigned int unused :23; unsigned int unused :25;
unsigned int depth; /* disable depth */
/* /*
* IRQ lock detection * IRQ lock detection
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment