aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-03-25 17:20:51 -0400
committerThomas Gleixner <tglx@linutronix.de>2011-03-29 08:47:58 -0400
commita6e120ed42004d6051fff7c3233e2554f12ccecb (patch)
treedd0210b2f78a5fca1b24fe8211d5dbaac9434a6b
parenta9eb076b21425929ce543978db03265d9db210de (diff)
alpha: Use generic show_interrupts()
The only subtle difference is that alpha uses ACTUAL_NR_IRQS and prints the IRQF_DISABLED flag. Change the generic implementation to deal with ACTUAL_NR_IRQS if defined. The IRQF_DISABLED printing is pointless, as we nowadays run all interrupts with irqs disabled. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/alpha/Kconfig1
-rw-r--r--arch/alpha/kernel/irq.c67
-rw-r--r--kernel/irq/proc.c8
3 files changed, 17 insertions, 59 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index cc31bec2e316..bd4160c57196 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -11,6 +11,7 @@ config ALPHA
11 select HAVE_GENERIC_HARDIRQS 11 select HAVE_GENERIC_HARDIRQS
12 select GENERIC_IRQ_PROBE 12 select GENERIC_IRQ_PROBE
13 select AUTO_IRQ_AFFINITY if SMP 13 select AUTO_IRQ_AFFINITY if SMP
14 select GENERIC_IRQ_SHOW
14 select GENERIC_HARDIRQS_NO_DEPRECATED 15 select GENERIC_HARDIRQS_NO_DEPRECATED
15 help 16 help
16 The Alpha is a 64-bit general-purpose processor designed and 17 The Alpha is a 64-bit general-purpose processor designed and
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
index 1461d7c53b41..381431a2d6d9 100644
--- a/arch/alpha/kernel/irq.c
+++ b/arch/alpha/kernel/irq.c
@@ -67,68 +67,21 @@ int irq_select_affinity(unsigned int irq)
67} 67}
68#endif /* CONFIG_SMP */ 68#endif /* CONFIG_SMP */
69 69
70int 70int arch_show_interrupts(struct seq_file *p, int prec)
71show_interrupts(struct seq_file *p, void *v)
72{ 71{
73 int j; 72 int j;
74 int irq = *(loff_t *) v;
75 struct irqaction * action;
76 struct irq_desc *desc;
77 unsigned long flags;
78 73
79#ifdef CONFIG_SMP 74#ifdef CONFIG_SMP
80 if (irq == 0) { 75 seq_puts(p, "IPI: ");
81 seq_puts(p, " "); 76 for_each_online_cpu(j)
82 for_each_online_cpu(j) 77 seq_printf(p, "%10lu ", cpu_data[j].ipi_count);
83 seq_printf(p, "CPU%d ", j); 78 seq_putc(p, '\n');
84 seq_putc(p, '\n');
85 }
86#endif
87
88 if (irq < ACTUAL_NR_IRQS) {
89 desc = irq_to_desc(irq);
90
91 if (!desc)
92 return 0;
93
94 raw_spin_lock_irqsave(&desc->lock, flags);
95 action = desc->action;
96 if (!action)
97 goto unlock;
98 seq_printf(p, "%3d: ", irq);
99#ifndef CONFIG_SMP
100 seq_printf(p, "%10u ", kstat_irqs(irq));
101#else
102 for_each_online_cpu(j)
103 seq_printf(p, "%10u ", kstat_irqs_cpu(irq, j));
104#endif 79#endif
105 seq_printf(p, " %14s", irq_desc_get_chip(desc)->name); 80 seq_puts(p, "PMI: ");
106 seq_printf(p, " %c%s", 81 for_each_online_cpu(j)
107 (action->flags & IRQF_DISABLED)?'+':' ', 82 seq_printf(p, "%10lu ", per_cpu(irq_pmi_count, j));
108 action->name); 83 seq_puts(p, " Performance Monitoring\n");
109 84 seq_printf(p, "ERR: %10lu\n", irq_err_count);
110 for (action=action->next; action; action = action->next) {
111 seq_printf(p, ", %c%s",
112 (action->flags & IRQF_DISABLED)?'+':' ',
113 action->name);
114 }
115
116 seq_putc(p, '\n');
117unlock:
118 raw_spin_unlock_irqrestore(&desc->lock, flags);
119 } else if (irq == ACTUAL_NR_IRQS) {
120#ifdef CONFIG_SMP
121 seq_puts(p, "IPI: ");
122 for_each_online_cpu(j)
123 seq_printf(p, "%10lu ", cpu_data[j].ipi_count);
124 seq_putc(p, '\n');
125#endif
126 seq_puts(p, "PMI: ");
127 for_each_online_cpu(j)
128 seq_printf(p, "%10lu ", per_cpu(irq_pmi_count, j));
129 seq_puts(p, " Performance Monitoring\n");
130 seq_printf(p, "ERR: %10lu\n", irq_err_count);
131 }
132 return 0; 85 return 0;
133} 86}
134 87
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 626d092eed9a..dd201bd35103 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -364,6 +364,10 @@ int __weak arch_show_interrupts(struct seq_file *p, int prec)
364 return 0; 364 return 0;
365} 365}
366 366
367#ifndef ACTUAL_NR_IRQS
368# define ACTUAL_NR_IRQS nr_irqs
369#endif
370
367int show_interrupts(struct seq_file *p, void *v) 371int show_interrupts(struct seq_file *p, void *v)
368{ 372{
369 static int prec; 373 static int prec;
@@ -373,10 +377,10 @@ int show_interrupts(struct seq_file *p, void *v)
373 struct irqaction *action; 377 struct irqaction *action;
374 struct irq_desc *desc; 378 struct irq_desc *desc;
375 379
376 if (i > nr_irqs) 380 if (i > ACTUAL_NR_IRQS)
377 return 0; 381 return 0;
378 382
379 if (i == nr_irqs) 383 if (i == ACTUAL_NR_IRQS)
380 return arch_show_interrupts(p, prec); 384 return arch_show_interrupts(p, prec);
381 385
382 /* print header and calculate the width of the first column */ 386 /* print header and calculate the width of the first column */