aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-02-07 15:48:49 -0500
committerThomas Gleixner <tglx@linutronix.de>2011-02-19 06:58:16 -0500
commit009b4c3b8ad584b3462734127a5bec680d5d6af4 (patch)
treef7cb860dde86ba96afcc085ec7a75ca2a41e49b6 /kernel/irq/manage.c
parent6954b75b488dd740950573f244ddd66fd28620aa (diff)
genirq: Add IRQ_INPROGRESS to core
We need to maintain the flag for now in both fields status and istate. Add a CONFIG_GENERIC_HARDIRQS_NO_COMPAT switch to allow testing w/o the status one. Wrap the access to status IRQ_INPROGRESS in a inline which can be turned of with CONFIG_GENERIC_HARDIRQS_NO_COMPAT along with the define. There is no reason that anything outside of core looks at this. That needs some modifications, but we'll get there. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 5b918ffa46af..7e5a50825088 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -30,7 +30,7 @@
30void synchronize_irq(unsigned int irq) 30void synchronize_irq(unsigned int irq)
31{ 31{
32 struct irq_desc *desc = irq_to_desc(irq); 32 struct irq_desc *desc = irq_to_desc(irq);
33 unsigned int status; 33 unsigned int state;
34 34
35 if (!desc) 35 if (!desc)
36 return; 36 return;
@@ -42,16 +42,16 @@ void synchronize_irq(unsigned int irq)
42 * Wait until we're out of the critical section. This might 42 * Wait until we're out of the critical section. This might
43 * give the wrong answer due to the lack of memory barriers. 43 * give the wrong answer due to the lack of memory barriers.
44 */ 44 */
45 while (desc->status & IRQ_INPROGRESS) 45 while (desc->istate & IRQS_INPROGRESS)
46 cpu_relax(); 46 cpu_relax();
47 47
48 /* Ok, that indicated we're done: double-check carefully. */ 48 /* Ok, that indicated we're done: double-check carefully. */
49 raw_spin_lock_irqsave(&desc->lock, flags); 49 raw_spin_lock_irqsave(&desc->lock, flags);
50 status = desc->status; 50 state = desc->istate;
51 raw_spin_unlock_irqrestore(&desc->lock, flags); 51 raw_spin_unlock_irqrestore(&desc->lock, flags);
52 52
53 /* Oops, that failed? */ 53 /* Oops, that failed? */
54 } while (status & IRQ_INPROGRESS); 54 } while (state & IRQS_INPROGRESS);
55 55
56 /* 56 /*
57 * We made sure that no hardirq handler is running. Now verify 57 * We made sure that no hardirq handler is running. Now verify
@@ -637,9 +637,9 @@ again:
637 * The thread is faster done than the hard interrupt handler 637 * The thread is faster done than the hard interrupt handler
638 * on the other CPU. If we unmask the irq line then the 638 * on the other CPU. If we unmask the irq line then the
639 * interrupt can come in again and masks the line, leaves due 639 * interrupt can come in again and masks the line, leaves due
640 * to IRQ_INPROGRESS and the irq line is masked forever. 640 * to IRQS_INPROGRESS and the irq line is masked forever.
641 */ 641 */
642 if (unlikely(desc->status & IRQ_INPROGRESS)) { 642 if (unlikely(desc->istate & IRQS_INPROGRESS)) {
643 raw_spin_unlock_irq(&desc->lock); 643 raw_spin_unlock_irq(&desc->lock);
644 chip_bus_sync_unlock(desc); 644 chip_bus_sync_unlock(desc);
645 cpu_relax(); 645 cpu_relax();
@@ -897,8 +897,9 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
897 desc->status |= IRQ_PER_CPU; 897 desc->status |= IRQ_PER_CPU;
898#endif 898#endif
899 899
900 desc->status &= ~(IRQ_WAITING | IRQ_ONESHOT | IRQ_INPROGRESS); 900 desc->status &= ~(IRQ_WAITING | IRQ_ONESHOT);
901 desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED); 901 desc->istate &= ~(IRQS_AUTODETECT | IRQS_SPURIOUS_DISABLED | \
902 IRQS_INPROGRESS);
902 903
903 if (new->flags & IRQF_ONESHOT) 904 if (new->flags & IRQF_ONESHOT)
904 desc->status |= IRQ_ONESHOT; 905 desc->status |= IRQ_ONESHOT;