diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2011-03-07 09:00:20 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-03-09 19:04:04 -0500 |
commit | e11802872db82417e51e1bbe0751dbb21842d713 (patch) | |
tree | 8f0610362a2671a367a6cf2288f3380a8097ab06 /arch | |
parent | 73909af7367a4daf2395846e776e0b326bd4e23b (diff) |
powerpc: core irq_data conversion.
Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/irq.c | 23 | ||||
-rw-r--r-- | arch/powerpc/kernel/machine_kexec.c | 21 |
2 files changed, 28 insertions, 16 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 8a958ca26ac2..0a5570338b96 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -237,6 +237,7 @@ int show_interrupts(struct seq_file *p, void *v) | |||
237 | int i = *(loff_t *) v, j, prec; | 237 | int i = *(loff_t *) v, j, prec; |
238 | struct irqaction *action; | 238 | struct irqaction *action; |
239 | struct irq_desc *desc; | 239 | struct irq_desc *desc; |
240 | struct irq_chip *chip; | ||
240 | 241 | ||
241 | if (i > nr_irqs) | 242 | if (i > nr_irqs) |
242 | return 0; | 243 | return 0; |
@@ -270,8 +271,9 @@ int show_interrupts(struct seq_file *p, void *v) | |||
270 | for_each_online_cpu(j) | 271 | for_each_online_cpu(j) |
271 | seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); | 272 | seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); |
272 | 273 | ||
273 | if (desc->chip) | 274 | chip = get_irq_desc_chip(desc); |
274 | seq_printf(p, " %-16s", desc->chip->name); | 275 | if (chip) |
276 | seq_printf(p, " %-16s", chip->name); | ||
275 | else | 277 | else |
276 | seq_printf(p, " %-16s", "None"); | 278 | seq_printf(p, " %-16s", "None"); |
277 | seq_printf(p, " %-8s", (desc->status & IRQ_LEVEL) ? "Level" : "Edge"); | 279 | seq_printf(p, " %-8s", (desc->status & IRQ_LEVEL) ? "Level" : "Edge"); |
@@ -313,6 +315,8 @@ void fixup_irqs(const struct cpumask *map) | |||
313 | alloc_cpumask_var(&mask, GFP_KERNEL); | 315 | alloc_cpumask_var(&mask, GFP_KERNEL); |
314 | 316 | ||
315 | for_each_irq(irq) { | 317 | for_each_irq(irq) { |
318 | struct irq_chip *chip; | ||
319 | |||
316 | desc = irq_to_desc(irq); | 320 | desc = irq_to_desc(irq); |
317 | if (!desc) | 321 | if (!desc) |
318 | continue; | 322 | continue; |
@@ -320,13 +324,15 @@ void fixup_irqs(const struct cpumask *map) | |||
320 | if (desc->status & IRQ_PER_CPU) | 324 | if (desc->status & IRQ_PER_CPU) |
321 | continue; | 325 | continue; |
322 | 326 | ||
323 | cpumask_and(mask, desc->affinity, map); | 327 | chip = get_irq_desc_chip(desc); |
328 | |||
329 | cpumask_and(mask, desc->irq_data.affinity, map); | ||
324 | if (cpumask_any(mask) >= nr_cpu_ids) { | 330 | if (cpumask_any(mask) >= nr_cpu_ids) { |
325 | printk("Breaking affinity for irq %i\n", irq); | 331 | printk("Breaking affinity for irq %i\n", irq); |
326 | cpumask_copy(mask, map); | 332 | cpumask_copy(mask, map); |
327 | } | 333 | } |
328 | if (desc->chip->set_affinity) | 334 | if (chip->irq_set_affinity) |
329 | desc->chip->set_affinity(irq, mask); | 335 | chip->irq_set_affinity(&desc->irq_data, mask, true); |
330 | else if (desc->action && !(warned++)) | 336 | else if (desc->action && !(warned++)) |
331 | printk("Cannot set affinity for irq %i\n", irq); | 337 | printk("Cannot set affinity for irq %i\n", irq); |
332 | } | 338 | } |
@@ -1145,11 +1151,14 @@ static int virq_debug_show(struct seq_file *m, void *private) | |||
1145 | raw_spin_lock_irqsave(&desc->lock, flags); | 1151 | raw_spin_lock_irqsave(&desc->lock, flags); |
1146 | 1152 | ||
1147 | if (desc->action && desc->action->handler) { | 1153 | if (desc->action && desc->action->handler) { |
1154 | struct irq_chip *chip; | ||
1155 | |||
1148 | seq_printf(m, "%5d ", i); | 1156 | seq_printf(m, "%5d ", i); |
1149 | seq_printf(m, "0x%05lx ", virq_to_hw(i)); | 1157 | seq_printf(m, "0x%05lx ", virq_to_hw(i)); |
1150 | 1158 | ||
1151 | if (desc->chip && desc->chip->name) | 1159 | chip = get_irq_desc_chip(desc); |
1152 | p = desc->chip->name; | 1160 | if (chip && chip->name) |
1161 | p = chip->name; | ||
1153 | else | 1162 | else |
1154 | p = none; | 1163 | p = none; |
1155 | seq_printf(m, "%-15s ", p); | 1164 | seq_printf(m, "%-15s ", p); |
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index 49a170af8145..976de37fe5b3 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c | |||
@@ -26,20 +26,23 @@ void machine_kexec_mask_interrupts(void) { | |||
26 | 26 | ||
27 | for_each_irq(i) { | 27 | for_each_irq(i) { |
28 | struct irq_desc *desc = irq_to_desc(i); | 28 | struct irq_desc *desc = irq_to_desc(i); |
29 | struct irq_chip *chip; | ||
29 | 30 | ||
30 | if (!desc || !desc->chip) | 31 | if (!desc) |
31 | continue; | 32 | continue; |
32 | 33 | ||
33 | if (desc->chip->eoi && | 34 | chip = get_irq_desc_chip(desc); |
34 | desc->status & IRQ_INPROGRESS) | 35 | if (!chip) |
35 | desc->chip->eoi(i); | 36 | continue; |
37 | |||
38 | if (chip->irq_eoi && desc->status & IRQ_INPROGRESS) | ||
39 | chip->irq_eoi(&desc->irq_data); | ||
36 | 40 | ||
37 | if (desc->chip->mask) | 41 | if (chip->irq_mask) |
38 | desc->chip->mask(i); | 42 | chip->irq_mask(&desc->irq_data); |
39 | 43 | ||
40 | if (desc->chip->disable && | 44 | if (chip->irq_disable && !(desc->status & IRQ_DISABLED)) |
41 | !(desc->status & IRQ_DISABLED)) | 45 | chip->irq_disable(&desc->irq_data); |
42 | desc->chip->disable(i); | ||
43 | } | 46 | } |
44 | } | 47 | } |
45 | 48 | ||