aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/irq.c')
-rw-r--r--arch/arm/kernel/irq.c70
1 files changed, 11 insertions, 59 deletions
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 3535d3793e65..83bbad03fcc6 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -51,63 +51,18 @@
51 51
52unsigned long irq_err_count; 52unsigned long irq_err_count;
53 53
54int show_interrupts(struct seq_file *p, void *v) 54int arch_show_interrupts(struct seq_file *p, int prec)
55{ 55{
56 int i = *(loff_t *) v, cpu;
57 struct irq_desc *desc;
58 struct irqaction * action;
59 unsigned long flags;
60 int prec, n;
61
62 for (prec = 3, n = 1000; prec < 10 && n <= nr_irqs; prec++)
63 n *= 10;
64
65#ifdef CONFIG_SMP
66 if (prec < 4)
67 prec = 4;
68#endif
69
70 if (i == 0) {
71 char cpuname[12];
72
73 seq_printf(p, "%*s ", prec, "");
74 for_each_present_cpu(cpu) {
75 sprintf(cpuname, "CPU%d", cpu);
76 seq_printf(p, " %10s", cpuname);
77 }
78 seq_putc(p, '\n');
79 }
80
81 if (i < nr_irqs) {
82 desc = irq_to_desc(i);
83 raw_spin_lock_irqsave(&desc->lock, flags);
84 action = desc->action;
85 if (!action)
86 goto unlock;
87
88 seq_printf(p, "%*d: ", prec, i);
89 for_each_present_cpu(cpu)
90 seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu));
91 seq_printf(p, " %10s", desc->irq_data.chip->name ? : "-");
92 seq_printf(p, " %s", action->name);
93 for (action = action->next; action; action = action->next)
94 seq_printf(p, ", %s", action->name);
95
96 seq_putc(p, '\n');
97unlock:
98 raw_spin_unlock_irqrestore(&desc->lock, flags);
99 } else if (i == nr_irqs) {
100#ifdef CONFIG_FIQ 56#ifdef CONFIG_FIQ
101 show_fiq_list(p, prec); 57 show_fiq_list(p, prec);
102#endif 58#endif
103#ifdef CONFIG_SMP 59#ifdef CONFIG_SMP
104 show_ipi_list(p, prec); 60 show_ipi_list(p, prec);
105#endif 61#endif
106#ifdef CONFIG_LOCAL_TIMERS 62#ifdef CONFIG_LOCAL_TIMERS
107 show_local_irqs(p, prec); 63 show_local_irqs(p, prec);
108#endif 64#endif
109 seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count); 65 seq_printf(p, "%*s: %10lu\n", prec, "Err", irq_err_count);
110 }
111 return 0; 66 return 0;
112} 67}
113 68
@@ -144,24 +99,21 @@ asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
144 99
145void set_irq_flags(unsigned int irq, unsigned int iflags) 100void set_irq_flags(unsigned int irq, unsigned int iflags)
146{ 101{
147 struct irq_desc *desc; 102 unsigned long clr = 0, set = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
148 unsigned long flags;
149 103
150 if (irq >= nr_irqs) { 104 if (irq >= nr_irqs) {
151 printk(KERN_ERR "Trying to set irq flags for IRQ%d\n", irq); 105 printk(KERN_ERR "Trying to set irq flags for IRQ%d\n", irq);
152 return; 106 return;
153 } 107 }
154 108
155 desc = irq_to_desc(irq);
156 raw_spin_lock_irqsave(&desc->lock, flags);
157 desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
158 if (iflags & IRQF_VALID) 109 if (iflags & IRQF_VALID)
159 desc->status &= ~IRQ_NOREQUEST; 110 clr |= IRQ_NOREQUEST;
160 if (iflags & IRQF_PROBE) 111 if (iflags & IRQF_PROBE)
161 desc->status &= ~IRQ_NOPROBE; 112 clr |= IRQ_NOPROBE;
162 if (!(iflags & IRQF_NOAUTOEN)) 113 if (!(iflags & IRQF_NOAUTOEN))
163 desc->status &= ~IRQ_NOAUTOEN; 114 clr |= IRQ_NOAUTOEN;
164 raw_spin_unlock_irqrestore(&desc->lock, flags); 115 /* Order is clear bits in "clr" then set bits in "set" */
116 irq_modify_status(irq, clr, set & ~clr);
165} 117}
166 118
167void __init init_IRQ(void) 119void __init init_IRQ(void)