aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha/kernel/irq.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/alpha/kernel/irq.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'arch/alpha/kernel/irq.c')
-rw-r--r--arch/alpha/kernel/irq.c83
1 files changed, 25 insertions, 58 deletions
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
index fe912984d9b1..381431a2d6d9 100644
--- a/arch/alpha/kernel/irq.c
+++ b/arch/alpha/kernel/irq.c
@@ -44,10 +44,16 @@ static char irq_user_affinity[NR_IRQS];
44 44
45int irq_select_affinity(unsigned int irq) 45int irq_select_affinity(unsigned int irq)
46{ 46{
47 struct irq_data *data = irq_get_irq_data(irq);
48 struct irq_chip *chip;
47 static int last_cpu; 49 static int last_cpu;
48 int cpu = last_cpu + 1; 50 int cpu = last_cpu + 1;
49 51
50 if (!irq_desc[irq].chip->set_affinity || irq_user_affinity[irq]) 52 if (!data)
53 return 1;
54 chip = irq_data_get_irq_chip(data);
55
56 if (!chip->irq_set_affinity || irq_user_affinity[irq])
51 return 1; 57 return 1;
52 58
53 while (!cpu_possible(cpu) || 59 while (!cpu_possible(cpu) ||
@@ -55,68 +61,27 @@ int irq_select_affinity(unsigned int irq)
55 cpu = (cpu < (NR_CPUS-1) ? cpu + 1 : 0); 61 cpu = (cpu < (NR_CPUS-1) ? cpu + 1 : 0);
56 last_cpu = cpu; 62 last_cpu = cpu;
57 63
58 cpumask_copy(irq_desc[irq].affinity, cpumask_of(cpu)); 64 cpumask_copy(data->affinity, cpumask_of(cpu));
59 irq_desc[irq].chip->set_affinity(irq, cpumask_of(cpu)); 65 chip->irq_set_affinity(data, cpumask_of(cpu), false);
60 return 0; 66 return 0;
61} 67}
62#endif /* CONFIG_SMP */ 68#endif /* CONFIG_SMP */
63 69
64int 70int arch_show_interrupts(struct seq_file *p, int prec)
65show_interrupts(struct seq_file *p, void *v)
66{ 71{
67 int j; 72 int j;
68 int irq = *(loff_t *) v;
69 struct irqaction * action;
70 unsigned long flags;
71
72#ifdef CONFIG_SMP
73 if (irq == 0) {
74 seq_puts(p, " ");
75 for_each_online_cpu(j)
76 seq_printf(p, "CPU%d ", j);
77 seq_putc(p, '\n');
78 }
79#endif
80 73
81 if (irq < ACTUAL_NR_IRQS) {
82 raw_spin_lock_irqsave(&irq_desc[irq].lock, flags);
83 action = irq_desc[irq].action;
84 if (!action)
85 goto unlock;
86 seq_printf(p, "%3d: ", irq);
87#ifndef CONFIG_SMP
88 seq_printf(p, "%10u ", kstat_irqs(irq));
89#else
90 for_each_online_cpu(j)
91 seq_printf(p, "%10u ", kstat_irqs_cpu(irq, j));
92#endif
93 seq_printf(p, " %14s", irq_desc[irq].chip->name);
94 seq_printf(p, " %c%s",
95 (action->flags & IRQF_DISABLED)?'+':' ',
96 action->name);
97
98 for (action=action->next; action; action = action->next) {
99 seq_printf(p, ", %c%s",
100 (action->flags & IRQF_DISABLED)?'+':' ',
101 action->name);
102 }
103
104 seq_putc(p, '\n');
105unlock:
106 raw_spin_unlock_irqrestore(&irq_desc[irq].lock, flags);
107 } else if (irq == ACTUAL_NR_IRQS) {
108#ifdef CONFIG_SMP 74#ifdef CONFIG_SMP
109 seq_puts(p, "IPI: "); 75 seq_puts(p, "IPI: ");
110 for_each_online_cpu(j) 76 for_each_online_cpu(j)
111 seq_printf(p, "%10lu ", cpu_data[j].ipi_count); 77 seq_printf(p, "%10lu ", cpu_data[j].ipi_count);
112 seq_putc(p, '\n'); 78 seq_putc(p, '\n');
113#endif 79#endif
114 seq_puts(p, "PMI: "); 80 seq_puts(p, "PMI: ");
115 for_each_online_cpu(j) 81 for_each_online_cpu(j)
116 seq_printf(p, "%10lu ", per_cpu(irq_pmi_count, j)); 82 seq_printf(p, "%10lu ", per_cpu(irq_pmi_count, j));
117 seq_puts(p, " Performance Monitoring\n"); 83 seq_puts(p, " Performance Monitoring\n");
118 seq_printf(p, "ERR: %10lu\n", irq_err_count); 84 seq_printf(p, "ERR: %10lu\n", irq_err_count);
119 }
120 return 0; 85 return 0;
121} 86}
122 87
@@ -142,8 +107,10 @@ handle_irq(int irq)
142 * handled by some other CPU. (or is disabled) 107 * handled by some other CPU. (or is disabled)
143 */ 108 */
144 static unsigned int illegal_count=0; 109 static unsigned int illegal_count=0;
110 struct irq_desc *desc = irq_to_desc(irq);
145 111
146 if ((unsigned) irq > ACTUAL_NR_IRQS && illegal_count < MAX_ILLEGAL_IRQS ) { 112 if (!desc || ((unsigned) irq > ACTUAL_NR_IRQS &&
113 illegal_count < MAX_ILLEGAL_IRQS)) {
147 irq_err_count++; 114 irq_err_count++;
148 illegal_count++; 115 illegal_count++;
149 printk(KERN_CRIT "device_interrupt: invalid interrupt %d\n", 116 printk(KERN_CRIT "device_interrupt: invalid interrupt %d\n",
@@ -151,14 +118,14 @@ handle_irq(int irq)
151 return; 118 return;
152 } 119 }
153 120
154 irq_enter();
155 /* 121 /*
156 * __do_IRQ() must be called with IPL_MAX. Note that we do not 122 * From here we must proceed with IPL_MAX. Note that we do not
157 * explicitly enable interrupts afterwards - some MILO PALcode 123 * explicitly enable interrupts afterwards - some MILO PALcode
158 * (namely LX164 one) seems to have severe problems with RTI 124 * (namely LX164 one) seems to have severe problems with RTI
159 * at IPL 0. 125 * at IPL 0.
160 */ 126 */
161 local_irq_disable(); 127 local_irq_disable();
162 __do_IRQ(irq); 128 irq_enter();
129 generic_handle_irq_desc(irq, desc);
163 irq_exit(); 130 irq_exit();
164} 131}