diff options
Diffstat (limited to 'arch/x86/kernel/irq.c')
-rw-r--r-- | arch/x86/kernel/irq.c | 91 |
1 files changed, 16 insertions, 75 deletions
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 387b6a0c9e8..948a31eae75 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c | |||
@@ -44,9 +44,9 @@ void ack_bad_irq(unsigned int irq) | |||
44 | 44 | ||
45 | #define irq_stats(x) (&per_cpu(irq_stat, x)) | 45 | #define irq_stats(x) (&per_cpu(irq_stat, x)) |
46 | /* | 46 | /* |
47 | * /proc/interrupts printing: | 47 | * /proc/interrupts printing for arch specific interrupts |
48 | */ | 48 | */ |
49 | static int show_other_interrupts(struct seq_file *p, int prec) | 49 | int arch_show_interrupts(struct seq_file *p, int prec) |
50 | { | 50 | { |
51 | int j; | 51 | int j; |
52 | 52 | ||
@@ -122,59 +122,6 @@ static int show_other_interrupts(struct seq_file *p, int prec) | |||
122 | return 0; | 122 | return 0; |
123 | } | 123 | } |
124 | 124 | ||
125 | int 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'); | ||
173 | out: | ||
174 | raw_spin_unlock_irqrestore(&desc->lock, flags); | ||
175 | return 0; | ||
176 | } | ||
177 | |||
178 | /* | 125 | /* |
179 | * /proc/stat helpers | 126 | * /proc/stat helpers |
180 | */ | 127 | */ |
@@ -276,15 +223,6 @@ void smp_x86_platform_ipi(struct pt_regs *regs) | |||
276 | 223 | ||
277 | EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq); | 224 | EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq); |
278 | 225 | ||
279 | #ifdef CONFIG_OF | ||
280 | unsigned int irq_create_of_mapping(struct device_node *controller, | ||
281 | const u32 *intspec, unsigned int intsize) | ||
282 | { | ||
283 | return intspec[0]; | ||
284 | } | ||
285 | EXPORT_SYMBOL_GPL(irq_create_of_mapping); | ||
286 | #endif | ||
287 | |||
288 | #ifdef CONFIG_HOTPLUG_CPU | 226 | #ifdef CONFIG_HOTPLUG_CPU |
289 | /* A cpu has been removed from cpu_online_mask. Reset irq affinities. */ | 227 | /* A cpu has been removed from cpu_online_mask. Reset irq affinities. */ |
290 | void fixup_irqs(void) | 228 | void fixup_irqs(void) |
@@ -293,6 +231,7 @@ void fixup_irqs(void) | |||
293 | static int warned; | 231 | static int warned; |
294 | struct irq_desc *desc; | 232 | struct irq_desc *desc; |
295 | struct irq_data *data; | 233 | struct irq_data *data; |
234 | struct irq_chip *chip; | ||
296 | 235 | ||
297 | for_each_irq_desc(irq, desc) { | 236 | for_each_irq_desc(irq, desc) { |
298 | int break_affinity = 0; | 237 | int break_affinity = 0; |
@@ -307,10 +246,10 @@ void fixup_irqs(void) | |||
307 | /* interrupt's are disabled at this point */ | 246 | /* interrupt's are disabled at this point */ |
308 | raw_spin_lock(&desc->lock); | 247 | raw_spin_lock(&desc->lock); |
309 | 248 | ||
310 | data = &desc->irq_data; | 249 | data = irq_desc_get_irq_data(desc); |
311 | affinity = data->affinity; | 250 | affinity = data->affinity; |
312 | if (!irq_has_action(irq) || | 251 | if (!irq_has_action(irq) || |
313 | cpumask_equal(affinity, cpu_online_mask)) { | 252 | cpumask_subset(affinity, cpu_online_mask)) { |
314 | raw_spin_unlock(&desc->lock); | 253 | raw_spin_unlock(&desc->lock); |
315 | continue; | 254 | continue; |
316 | } | 255 | } |
@@ -327,16 +266,17 @@ void fixup_irqs(void) | |||
327 | affinity = cpu_all_mask; | 266 | affinity = cpu_all_mask; |
328 | } | 267 | } |
329 | 268 | ||
330 | if (!(desc->status & IRQ_MOVE_PCNTXT) && data->chip->irq_mask) | 269 | chip = irq_data_get_irq_chip(data); |
331 | data->chip->irq_mask(data); | 270 | if (!irqd_can_move_in_process_context(data) && chip->irq_mask) |
271 | chip->irq_mask(data); | ||
332 | 272 | ||
333 | if (data->chip->irq_set_affinity) | 273 | if (chip->irq_set_affinity) |
334 | data->chip->irq_set_affinity(data, affinity, true); | 274 | chip->irq_set_affinity(data, affinity, true); |
335 | else if (!(warned++)) | 275 | else if (!(warned++)) |
336 | set_affinity = 0; | 276 | set_affinity = 0; |
337 | 277 | ||
338 | if (!(desc->status & IRQ_MOVE_PCNTXT) && data->chip->irq_unmask) | 278 | if (!irqd_can_move_in_process_context(data) && chip->irq_unmask) |
339 | data->chip->irq_unmask(data); | 279 | chip->irq_unmask(data); |
340 | 280 | ||
341 | raw_spin_unlock(&desc->lock); | 281 | raw_spin_unlock(&desc->lock); |
342 | 282 | ||
@@ -368,10 +308,11 @@ void fixup_irqs(void) | |||
368 | irq = __this_cpu_read(vector_irq[vector]); | 308 | irq = __this_cpu_read(vector_irq[vector]); |
369 | 309 | ||
370 | desc = irq_to_desc(irq); | 310 | desc = irq_to_desc(irq); |
371 | data = &desc->irq_data; | 311 | data = irq_desc_get_irq_data(desc); |
312 | chip = irq_data_get_irq_chip(data); | ||
372 | raw_spin_lock(&desc->lock); | 313 | raw_spin_lock(&desc->lock); |
373 | if (data->chip->irq_retrigger) | 314 | if (chip->irq_retrigger) |
374 | data->chip->irq_retrigger(data); | 315 | chip->irq_retrigger(data); |
375 | raw_spin_unlock(&desc->lock); | 316 | raw_spin_unlock(&desc->lock); |
376 | } | 317 | } |
377 | } | 318 | } |