aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorUwe Kleine-König <Uwe.Kleine-Koenig@digi.com>2008-02-29 07:27:53 -0500
committerUwe Kleine-König <Uwe.Kleine-Koenig@digi.com>2008-03-31 02:17:01 -0400
commit5e69b945f20aec17bf057acbb61b6682461e7149 (patch)
tree3500ea8f1357f2bb6e50375a76751c45685118ec /arch/arm
parenta287453e37a11a128ee0761e1db2e79d7faacdb3 (diff)
ns9xxx: make use of the chip's irq priorisation
The irq controller automatically masks the current and all lower prioritised tasks until the current irq is acked. Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-ns9xxx/irq.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/arch/arm/mach-ns9xxx/irq.c b/arch/arm/mach-ns9xxx/irq.c
index d4a583cc44c5..7ddc8fde7748 100644
--- a/arch/arm/mach-ns9xxx/irq.c
+++ b/arch/arm/mach-ns9xxx/irq.c
@@ -9,6 +9,7 @@
9 * the Free Software Foundation. 9 * the Free Software Foundation.
10 */ 10 */
11#include <linux/interrupt.h> 11#include <linux/interrupt.h>
12#include <linux/kernel_stat.h>
12#include <asm/io.h> 13#include <asm/io.h>
13#include <asm/mach/irq.h> 14#include <asm/mach/irq.h>
14#include <asm/mach-types.h> 15#include <asm/mach-types.h>
@@ -52,6 +53,43 @@ static struct irq_chip ns9xxx_chip = {
52 .unmask = ns9xxx_unmask_irq, 53 .unmask = ns9xxx_unmask_irq,
53}; 54};
54 55
56#if 0
57#define handle_irq handle_level_irq
58#else
59void handle_prio_irq(unsigned int irq, struct irq_desc *desc)
60{
61 unsigned int cpu = smp_processor_id();
62 struct irqaction *action;
63 irqreturn_t action_ret;
64
65 spin_lock(&desc->lock);
66
67 if (unlikely(desc->status & IRQ_INPROGRESS))
68 goto out_unlock;
69
70 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
71 kstat_cpu(cpu).irqs[irq]++;
72
73 action = desc->action;
74 if (unlikely(!action || (desc->status & IRQ_DISABLED)))
75 goto out_unlock;
76
77 desc->status |= IRQ_INPROGRESS;
78 spin_unlock(&desc->lock);
79
80 action_ret = handle_IRQ_event(irq, action);
81
82 spin_lock(&desc->lock);
83 desc->status &= ~IRQ_INPROGRESS;
84 if (!(desc->status & IRQ_DISABLED) && desc->chip->ack)
85 desc->chip->ack(irq);
86
87out_unlock:
88 spin_unlock(&desc->lock);
89}
90#define handle_irq handle_prio_irq
91#endif
92
55void __init ns9xxx_init_irq(void) 93void __init ns9xxx_init_irq(void)
56{ 94{
57 int i; 95 int i;
@@ -69,7 +107,7 @@ void __init ns9xxx_init_irq(void)
69 107
70 for (i = 0; i <= 31; ++i) { 108 for (i = 0; i <= 31; ++i) {
71 set_irq_chip(i, &ns9xxx_chip); 109 set_irq_chip(i, &ns9xxx_chip);
72 set_irq_handler(i, handle_level_irq); 110 set_irq_handler(i, handle_irq);
73 set_irq_flags(i, IRQF_VALID); 111 set_irq_flags(i, IRQF_VALID);
74 } 112 }
75} 113}