aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/irq.c')
-rw-r--r--arch/powerpc/kernel/irq.c81
1 files changed, 12 insertions, 69 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 0a5570338b96..63625e0650b5 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -195,7 +195,7 @@ notrace void arch_local_irq_restore(unsigned long en)
195EXPORT_SYMBOL(arch_local_irq_restore); 195EXPORT_SYMBOL(arch_local_irq_restore);
196#endif /* CONFIG_PPC64 */ 196#endif /* CONFIG_PPC64 */
197 197
198static int show_other_interrupts(struct seq_file *p, int prec) 198int arch_show_interrupts(struct seq_file *p, int prec)
199{ 199{
200 int j; 200 int j;
201 201
@@ -231,65 +231,6 @@ static int show_other_interrupts(struct seq_file *p, int prec)
231 return 0; 231 return 0;
232} 232}
233 233
234int show_interrupts(struct seq_file *p, void *v)
235{
236 unsigned long flags, any_count = 0;
237 int i = *(loff_t *) v, j, prec;
238 struct irqaction *action;
239 struct irq_desc *desc;
240 struct irq_chip *chip;
241
242 if (i > nr_irqs)
243 return 0;
244
245 for (prec = 3, j = 1000; prec < 10 && j <= nr_irqs; ++prec)
246 j *= 10;
247
248 if (i == nr_irqs)
249 return show_other_interrupts(p, prec);
250
251 /* print header */
252 if (i == 0) {
253 seq_printf(p, "%*s", prec + 8, "");
254 for_each_online_cpu(j)
255 seq_printf(p, "CPU%-8d", j);
256 seq_putc(p, '\n');
257 }
258
259 desc = irq_to_desc(i);
260 if (!desc)
261 return 0;
262
263 raw_spin_lock_irqsave(&desc->lock, flags);
264 for_each_online_cpu(j)
265 any_count |= kstat_irqs_cpu(i, j);
266 action = desc->action;
267 if (!action && !any_count)
268 goto out;
269
270 seq_printf(p, "%*d: ", prec, i);
271 for_each_online_cpu(j)
272 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
273
274 chip = get_irq_desc_chip(desc);
275 if (chip)
276 seq_printf(p, " %-16s", chip->name);
277 else
278 seq_printf(p, " %-16s", "None");
279 seq_printf(p, " %-8s", (desc->status & IRQ_LEVEL) ? "Level" : "Edge");
280
281 if (action) {
282 seq_printf(p, " %s", action->name);
283 while ((action = action->next) != NULL)
284 seq_printf(p, ", %s", action->name);
285 }
286
287 seq_putc(p, '\n');
288out:
289 raw_spin_unlock_irqrestore(&desc->lock, flags);
290 return 0;
291}
292
293/* 234/*
294 * /proc/stat helpers 235 * /proc/stat helpers
295 */ 236 */
@@ -315,24 +256,26 @@ void fixup_irqs(const struct cpumask *map)
315 alloc_cpumask_var(&mask, GFP_KERNEL); 256 alloc_cpumask_var(&mask, GFP_KERNEL);
316 257
317 for_each_irq(irq) { 258 for_each_irq(irq) {
259 struct irq_data *data;
318 struct irq_chip *chip; 260 struct irq_chip *chip;
319 261
320 desc = irq_to_desc(irq); 262 desc = irq_to_desc(irq);
321 if (!desc) 263 if (!desc)
322 continue; 264 continue;
323 265
324 if (desc->status & IRQ_PER_CPU) 266 data = irq_desc_get_irq_data(desc);
267 if (irqd_is_per_cpu(data))
325 continue; 268 continue;
326 269
327 chip = get_irq_desc_chip(desc); 270 chip = irq_data_get_irq_chip(data);
328 271
329 cpumask_and(mask, desc->irq_data.affinity, map); 272 cpumask_and(mask, data->affinity, map);
330 if (cpumask_any(mask) >= nr_cpu_ids) { 273 if (cpumask_any(mask) >= nr_cpu_ids) {
331 printk("Breaking affinity for irq %i\n", irq); 274 printk("Breaking affinity for irq %i\n", irq);
332 cpumask_copy(mask, map); 275 cpumask_copy(mask, map);
333 } 276 }
334 if (chip->irq_set_affinity) 277 if (chip->irq_set_affinity)
335 chip->irq_set_affinity(&desc->irq_data, mask, true); 278 chip->irq_set_affinity(data, mask, true);
336 else if (desc->action && !(warned++)) 279 else if (desc->action && !(warned++))
337 printk("Cannot set affinity for irq %i\n", irq); 280 printk("Cannot set affinity for irq %i\n", irq);
338 } 281 }
@@ -618,7 +561,7 @@ struct irq_host *irq_alloc_host(struct device_node *of_node,
618 smp_wmb(); 561 smp_wmb();
619 562
620 /* Clear norequest flags */ 563 /* Clear norequest flags */
621 irq_to_desc(i)->status &= ~IRQ_NOREQUEST; 564 irq_clear_status_flags(i, IRQ_NOREQUEST);
622 565
623 /* Legacy flags are left to default at this point, 566 /* Legacy flags are left to default at this point,
624 * one can then use irq_create_mapping() to 567 * one can then use irq_create_mapping() to
@@ -827,8 +770,8 @@ unsigned int irq_create_of_mapping(struct device_node *controller,
827 770
828 /* Set type if specified and different than the current one */ 771 /* Set type if specified and different than the current one */
829 if (type != IRQ_TYPE_NONE && 772 if (type != IRQ_TYPE_NONE &&
830 type != (irq_to_desc(virq)->status & IRQF_TRIGGER_MASK)) 773 type != (irqd_get_trigger_type(irq_get_irq_data(virq))))
831 set_irq_type(virq, type); 774 irq_set_irq_type(virq, type);
832 return virq; 775 return virq;
833} 776}
834EXPORT_SYMBOL_GPL(irq_create_of_mapping); 777EXPORT_SYMBOL_GPL(irq_create_of_mapping);
@@ -851,7 +794,7 @@ void irq_dispose_mapping(unsigned int virq)
851 return; 794 return;
852 795
853 /* remove chip and handler */ 796 /* remove chip and handler */
854 set_irq_chip_and_handler(virq, NULL, NULL); 797 irq_set_chip_and_handler(virq, NULL, NULL);
855 798
856 /* Make sure it's completed */ 799 /* Make sure it's completed */
857 synchronize_irq(virq); 800 synchronize_irq(virq);
@@ -1156,7 +1099,7 @@ static int virq_debug_show(struct seq_file *m, void *private)
1156 seq_printf(m, "%5d ", i); 1099 seq_printf(m, "%5d ", i);
1157 seq_printf(m, "0x%05lx ", virq_to_hw(i)); 1100 seq_printf(m, "0x%05lx ", virq_to_hw(i));
1158 1101
1159 chip = get_irq_desc_chip(desc); 1102 chip = irq_desc_get_chip(desc);
1160 if (chip && chip->name) 1103 if (chip && chip->name)
1161 p = chip->name; 1104 p = chip->name;
1162 else 1105 else