aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/irq.c')
-rw-r--r--arch/x86/kernel/irq.c93
1 files changed, 18 insertions, 75 deletions
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 52945da52a94..1cb0b9fc78dc 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -8,6 +8,7 @@
8#include <linux/seq_file.h> 8#include <linux/seq_file.h>
9#include <linux/smp.h> 9#include <linux/smp.h>
10#include <linux/ftrace.h> 10#include <linux/ftrace.h>
11#include <linux/delay.h>
11 12
12#include <asm/apic.h> 13#include <asm/apic.h>
13#include <asm/io_apic.h> 14#include <asm/io_apic.h>
@@ -44,9 +45,9 @@ void ack_bad_irq(unsigned int irq)
44 45
45#define irq_stats(x) (&per_cpu(irq_stat, x)) 46#define irq_stats(x) (&per_cpu(irq_stat, x))
46/* 47/*
47 * /proc/interrupts printing: 48 * /proc/interrupts printing for arch specific interrupts
48 */ 49 */
49static int show_other_interrupts(struct seq_file *p, int prec) 50int arch_show_interrupts(struct seq_file *p, int prec)
50{ 51{
51 int j; 52 int j;
52 53
@@ -122,59 +123,6 @@ static int show_other_interrupts(struct seq_file *p, int prec)
122 return 0; 123 return 0;
123} 124}
124 125
125int show_interrupts(struct seq_file *p, void *v)
126{
127 unsigned long flags, any_count = 0;
128 int i = *(loff_t *) v, j, prec;
129 struct irqaction *action;
130 struct irq_desc *desc;
131
132 if (i > nr_irqs)
133 return 0;
134
135 for (prec = 3, j = 1000; prec < 10 && j <= nr_irqs; ++prec)
136 j *= 10;
137
138 if (i == nr_irqs)
139 return show_other_interrupts(p, prec);
140
141 /* print header */
142 if (i == 0) {
143 seq_printf(p, "%*s", prec + 8, "");
144 for_each_online_cpu(j)
145 seq_printf(p, "CPU%-8d", j);
146 seq_putc(p, '\n');
147 }
148
149 desc = irq_to_desc(i);
150 if (!desc)
151 return 0;
152
153 raw_spin_lock_irqsave(&desc->lock, flags);
154 for_each_online_cpu(j)
155 any_count |= kstat_irqs_cpu(i, j);
156 action = desc->action;
157 if (!action && !any_count)
158 goto out;
159
160 seq_printf(p, "%*d: ", prec, i);
161 for_each_online_cpu(j)
162 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
163 seq_printf(p, " %8s", desc->irq_data.chip->name);
164 seq_printf(p, "-%-8s", desc->name);
165
166 if (action) {
167 seq_printf(p, " %s", action->name);
168 while ((action = action->next) != NULL)
169 seq_printf(p, ", %s", action->name);
170 }
171
172 seq_putc(p, '\n');
173out:
174 raw_spin_unlock_irqrestore(&desc->lock, flags);
175 return 0;
176}
177
178/* 126/*
179 * /proc/stat helpers 127 * /proc/stat helpers
180 */ 128 */
@@ -276,15 +224,6 @@ void smp_x86_platform_ipi(struct pt_regs *regs)
276 224
277EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq); 225EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq);
278 226
279#ifdef CONFIG_OF
280unsigned int irq_create_of_mapping(struct device_node *controller,
281 const u32 *intspec, unsigned int intsize)
282{
283 return intspec[0];
284}
285EXPORT_SYMBOL_GPL(irq_create_of_mapping);
286#endif
287
288#ifdef CONFIG_HOTPLUG_CPU 227#ifdef CONFIG_HOTPLUG_CPU
289/* A cpu has been removed from cpu_online_mask. Reset irq affinities. */ 228/* A cpu has been removed from cpu_online_mask. Reset irq affinities. */
290void fixup_irqs(void) 229void fixup_irqs(void)
@@ -293,6 +232,7 @@ void fixup_irqs(void)
293 static int warned; 232 static int warned;
294 struct irq_desc *desc; 233 struct irq_desc *desc;
295 struct irq_data *data; 234 struct irq_data *data;
235 struct irq_chip *chip;
296 236
297 for_each_irq_desc(irq, desc) { 237 for_each_irq_desc(irq, desc) {
298 int break_affinity = 0; 238 int break_affinity = 0;
@@ -307,10 +247,10 @@ void fixup_irqs(void)
307 /* interrupt's are disabled at this point */ 247 /* interrupt's are disabled at this point */
308 raw_spin_lock(&desc->lock); 248 raw_spin_lock(&desc->lock);
309 249
310 data = &desc->irq_data; 250 data = irq_desc_get_irq_data(desc);
311 affinity = data->affinity; 251 affinity = data->affinity;
312 if (!irq_has_action(irq) || 252 if (!irq_has_action(irq) ||
313 cpumask_equal(affinity, cpu_online_mask)) { 253 cpumask_subset(affinity, cpu_online_mask)) {
314 raw_spin_unlock(&desc->lock); 254 raw_spin_unlock(&desc->lock);
315 continue; 255 continue;
316 } 256 }
@@ -327,16 +267,17 @@ void fixup_irqs(void)
327 affinity = cpu_all_mask; 267 affinity = cpu_all_mask;
328 } 268 }
329 269
330 if (!(desc->status & IRQ_MOVE_PCNTXT) && data->chip->irq_mask) 270 chip = irq_data_get_irq_chip(data);
331 data->chip->irq_mask(data); 271 if (!irqd_can_move_in_process_context(data) && chip->irq_mask)
272 chip->irq_mask(data);
332 273
333 if (data->chip->irq_set_affinity) 274 if (chip->irq_set_affinity)
334 data->chip->irq_set_affinity(data, affinity, true); 275 chip->irq_set_affinity(data, affinity, true);
335 else if (!(warned++)) 276 else if (!(warned++))
336 set_affinity = 0; 277 set_affinity = 0;
337 278
338 if (!(desc->status & IRQ_MOVE_PCNTXT) && data->chip->irq_unmask) 279 if (!irqd_can_move_in_process_context(data) && chip->irq_unmask)
339 data->chip->irq_unmask(data); 280 chip->irq_unmask(data);
340 281
341 raw_spin_unlock(&desc->lock); 282 raw_spin_unlock(&desc->lock);
342 283
@@ -367,10 +308,12 @@ void fixup_irqs(void)
367 if (irr & (1 << (vector % 32))) { 308 if (irr & (1 << (vector % 32))) {
368 irq = __this_cpu_read(vector_irq[vector]); 309 irq = __this_cpu_read(vector_irq[vector]);
369 310
370 data = irq_get_irq_data(irq); 311 desc = irq_to_desc(irq);
312 data = irq_desc_get_irq_data(desc);
313 chip = irq_data_get_irq_chip(data);
371 raw_spin_lock(&desc->lock); 314 raw_spin_lock(&desc->lock);
372 if (data->chip->irq_retrigger) 315 if (chip->irq_retrigger)
373 data->chip->irq_retrigger(data); 316 chip->irq_retrigger(data);
374 raw_spin_unlock(&desc->lock); 317 raw_spin_unlock(&desc->lock);
375 } 318 }
376 } 319 }