diff options
Diffstat (limited to 'arch/x86/kernel/irq.c')
-rw-r--r-- | arch/x86/kernel/irq.c | 82 |
1 files changed, 16 insertions, 66 deletions
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 387b6a0c9e81..5ee693faa111 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 | */ |
@@ -293,6 +240,7 @@ void fixup_irqs(void) | |||
293 | static int warned; | 240 | static int warned; |
294 | struct irq_desc *desc; | 241 | struct irq_desc *desc; |
295 | struct irq_data *data; | 242 | struct irq_data *data; |
243 | struct irq_chip *chip; | ||
296 | 244 | ||
297 | for_each_irq_desc(irq, desc) { | 245 | for_each_irq_desc(irq, desc) { |
298 | int break_affinity = 0; | 246 | int break_affinity = 0; |
@@ -307,10 +255,10 @@ void fixup_irqs(void) | |||
307 | /* interrupt's are disabled at this point */ | 255 | /* interrupt's are disabled at this point */ |
308 | raw_spin_lock(&desc->lock); | 256 | raw_spin_lock(&desc->lock); |
309 | 257 | ||
310 | data = &desc->irq_data; | 258 | data = irq_desc_get_irq_data(desc); |
311 | affinity = data->affinity; | 259 | affinity = data->affinity; |
312 | if (!irq_has_action(irq) || | 260 | if (!irq_has_action(irq) || |
313 | cpumask_equal(affinity, cpu_online_mask)) { | 261 | cpumask_subset(affinity, cpu_online_mask)) { |
314 | raw_spin_unlock(&desc->lock); | 262 | raw_spin_unlock(&desc->lock); |
315 | continue; | 263 | continue; |
316 | } | 264 | } |
@@ -327,16 +275,17 @@ void fixup_irqs(void) | |||
327 | affinity = cpu_all_mask; | 275 | affinity = cpu_all_mask; |
328 | } | 276 | } |
329 | 277 | ||
330 | if (!(desc->status & IRQ_MOVE_PCNTXT) && data->chip->irq_mask) | 278 | chip = irq_data_get_irq_chip(data); |
331 | data->chip->irq_mask(data); | 279 | if (!irqd_can_move_in_process_context(data) && chip->irq_mask) |
280 | chip->irq_mask(data); | ||
332 | 281 | ||
333 | if (data->chip->irq_set_affinity) | 282 | if (chip->irq_set_affinity) |
334 | data->chip->irq_set_affinity(data, affinity, true); | 283 | chip->irq_set_affinity(data, affinity, true); |
335 | else if (!(warned++)) | 284 | else if (!(warned++)) |
336 | set_affinity = 0; | 285 | set_affinity = 0; |
337 | 286 | ||
338 | if (!(desc->status & IRQ_MOVE_PCNTXT) && data->chip->irq_unmask) | 287 | if (!irqd_can_move_in_process_context(data) && chip->irq_unmask) |
339 | data->chip->irq_unmask(data); | 288 | chip->irq_unmask(data); |
340 | 289 | ||
341 | raw_spin_unlock(&desc->lock); | 290 | raw_spin_unlock(&desc->lock); |
342 | 291 | ||
@@ -368,10 +317,11 @@ void fixup_irqs(void) | |||
368 | irq = __this_cpu_read(vector_irq[vector]); | 317 | irq = __this_cpu_read(vector_irq[vector]); |
369 | 318 | ||
370 | desc = irq_to_desc(irq); | 319 | desc = irq_to_desc(irq); |
371 | data = &desc->irq_data; | 320 | data = irq_desc_get_irq_data(desc); |
321 | chip = irq_data_get_irq_chip(data); | ||
372 | raw_spin_lock(&desc->lock); | 322 | raw_spin_lock(&desc->lock); |
373 | if (data->chip->irq_retrigger) | 323 | if (chip->irq_retrigger) |
374 | data->chip->irq_retrigger(data); | 324 | chip->irq_retrigger(data); |
375 | raw_spin_unlock(&desc->lock); | 325 | raw_spin_unlock(&desc->lock); |
376 | } | 326 | } |
377 | } | 327 | } |