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.c84
1 files changed, 14 insertions, 70 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 0a5570338b96..f621b7d2d869 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 */
@@ -305,34 +246,37 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
305} 246}
306 247
307#ifdef CONFIG_HOTPLUG_CPU 248#ifdef CONFIG_HOTPLUG_CPU
308void fixup_irqs(const struct cpumask *map) 249void migrate_irqs(void)
309{ 250{
310 struct irq_desc *desc; 251 struct irq_desc *desc;
311 unsigned int irq; 252 unsigned int irq;
312 static int warned; 253 static int warned;
313 cpumask_var_t mask; 254 cpumask_var_t mask;
255 const struct cpumask *map = cpu_online_mask;
314 256
315 alloc_cpumask_var(&mask, GFP_KERNEL); 257 alloc_cpumask_var(&mask, GFP_KERNEL);
316 258
317 for_each_irq(irq) { 259 for_each_irq(irq) {
260 struct irq_data *data;
318 struct irq_chip *chip; 261 struct irq_chip *chip;
319 262
320 desc = irq_to_desc(irq); 263 desc = irq_to_desc(irq);
321 if (!desc) 264 if (!desc)
322 continue; 265 continue;
323 266
324 if (desc->status & IRQ_PER_CPU) 267 data = irq_desc_get_irq_data(desc);
268 if (irqd_is_per_cpu(data))
325 continue; 269 continue;
326 270
327 chip = get_irq_desc_chip(desc); 271 chip = irq_data_get_irq_chip(data);
328 272
329 cpumask_and(mask, desc->irq_data.affinity, map); 273 cpumask_and(mask, data->affinity, map);
330 if (cpumask_any(mask) >= nr_cpu_ids) { 274 if (cpumask_any(mask) >= nr_cpu_ids) {
331 printk("Breaking affinity for irq %i\n", irq); 275 printk("Breaking affinity for irq %i\n", irq);
332 cpumask_copy(mask, map); 276 cpumask_copy(mask, map);
333 } 277 }
334 if (chip->irq_set_affinity) 278 if (chip->irq_set_affinity)
335 chip->irq_set_affinity(&desc->irq_data, mask, true); 279 chip->irq_set_affinity(data, mask, true);
336 else if (desc->action && !(warned++)) 280 else if (desc->action && !(warned++))
337 printk("Cannot set affinity for irq %i\n", irq); 281 printk("Cannot set affinity for irq %i\n", irq);
338 } 282 }
@@ -618,7 +562,7 @@ struct irq_host *irq_alloc_host(struct device_node *of_node,
618 smp_wmb(); 562 smp_wmb();
619 563
620 /* Clear norequest flags */ 564 /* Clear norequest flags */
621 irq_to_desc(i)->status &= ~IRQ_NOREQUEST; 565 irq_clear_status_flags(i, IRQ_NOREQUEST);
622 566
623 /* Legacy flags are left to default at this point, 567 /* Legacy flags are left to default at this point,
624 * one can then use irq_create_mapping() to 568 * one can then use irq_create_mapping() to
@@ -827,8 +771,8 @@ unsigned int irq_create_of_mapping(struct device_node *controller,
827 771
828 /* Set type if specified and different than the current one */ 772 /* Set type if specified and different than the current one */
829 if (type != IRQ_TYPE_NONE && 773 if (type != IRQ_TYPE_NONE &&
830 type != (irq_to_desc(virq)->status & IRQF_TRIGGER_MASK)) 774 type != (irqd_get_trigger_type(irq_get_irq_data(virq))))
831 set_irq_type(virq, type); 775 irq_set_irq_type(virq, type);
832 return virq; 776 return virq;
833} 777}
834EXPORT_SYMBOL_GPL(irq_create_of_mapping); 778EXPORT_SYMBOL_GPL(irq_create_of_mapping);
@@ -851,7 +795,7 @@ void irq_dispose_mapping(unsigned int virq)
851 return; 795 return;
852 796
853 /* remove chip and handler */ 797 /* remove chip and handler */
854 set_irq_chip_and_handler(virq, NULL, NULL); 798 irq_set_chip_and_handler(virq, NULL, NULL);
855 799
856 /* Make sure it's completed */ 800 /* Make sure it's completed */
857 synchronize_irq(virq); 801 synchronize_irq(virq);
@@ -1156,7 +1100,7 @@ static int virq_debug_show(struct seq_file *m, void *private)
1156 seq_printf(m, "%5d ", i); 1100 seq_printf(m, "%5d ", i);
1157 seq_printf(m, "0x%05lx ", virq_to_hw(i)); 1101 seq_printf(m, "0x%05lx ", virq_to_hw(i));
1158 1102
1159 chip = get_irq_desc_chip(desc); 1103 chip = irq_desc_get_chip(desc);
1160 if (chip && chip->name) 1104 if (chip && chip->name)
1161 p = chip->name; 1105 p = chip->name;
1162 else 1106 else