aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2010-04-26 11:32:35 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-05-06 03:16:14 -0400
commitb6decb707952c678d110699abb5ed86d45ca6927 (patch)
tree6e206cc19c9f6ac9358be30593866a8a057d508d
parentbfb9126defa80cbed6d91ed9685b238b0d7e81c4 (diff)
powerpc/cpumask: Convert fixup_irqs to new cpumask API
Use new cpumask_* functions, and dynamically allocate cpumask in fixup_irqs. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/include/asm/smp.h2
-rw-r--r--arch/powerpc/kernel/irq.c17
-rw-r--r--arch/powerpc/kernel/smp.c4
3 files changed, 13 insertions, 10 deletions
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index 1d3b270d3083..4d332296c40d 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -40,7 +40,7 @@ extern void smp_message_recv(int);
40DECLARE_PER_CPU(unsigned int, cpu_pvr); 40DECLARE_PER_CPU(unsigned int, cpu_pvr);
41 41
42#ifdef CONFIG_HOTPLUG_CPU 42#ifdef CONFIG_HOTPLUG_CPU
43extern void fixup_irqs(cpumask_t map); 43extern void fixup_irqs(const struct cpumask *map);
44int generic_cpu_disable(void); 44int generic_cpu_disable(void);
45int generic_cpu_enable(unsigned int cpu); 45int generic_cpu_enable(unsigned int cpu);
46void generic_cpu_die(unsigned int cpu); 46void generic_cpu_die(unsigned int cpu);
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 64f6f2031c22..250ee2ebf288 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -290,30 +290,33 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
290} 290}
291 291
292#ifdef CONFIG_HOTPLUG_CPU 292#ifdef CONFIG_HOTPLUG_CPU
293void fixup_irqs(cpumask_t map) 293void fixup_irqs(const struct cpumask *map)
294{ 294{
295 struct irq_desc *desc; 295 struct irq_desc *desc;
296 unsigned int irq; 296 unsigned int irq;
297 static int warned; 297 static int warned;
298 cpumask_var_t mask;
298 299
299 for_each_irq(irq) { 300 alloc_cpumask_var(&mask, GFP_KERNEL);
300 cpumask_t mask;
301 301
302 for_each_irq(irq) {
302 desc = irq_to_desc(irq); 303 desc = irq_to_desc(irq);
303 if (desc && desc->status & IRQ_PER_CPU) 304 if (desc && desc->status & IRQ_PER_CPU)
304 continue; 305 continue;
305 306
306 cpumask_and(&mask, desc->affinity, &map); 307 cpumask_and(mask, desc->affinity, map);
307 if (any_online_cpu(mask) == NR_CPUS) { 308 if (cpumask_any(mask) >= nr_cpu_ids) {
308 printk("Breaking affinity for irq %i\n", irq); 309 printk("Breaking affinity for irq %i\n", irq);
309 mask = map; 310 cpumask_copy(mask, map);
310 } 311 }
311 if (desc->chip->set_affinity) 312 if (desc->chip->set_affinity)
312 desc->chip->set_affinity(irq, &mask); 313 desc->chip->set_affinity(irq, mask);
313 else if (desc->action && !(warned++)) 314 else if (desc->action && !(warned++))
314 printk("Cannot set affinity for irq %i\n", irq); 315 printk("Cannot set affinity for irq %i\n", irq);
315 } 316 }
316 317
318 free_cpumask_var(mask);
319
317 local_irq_enable(); 320 local_irq_enable();
318 mdelay(1); 321 mdelay(1);
319 local_irq_disable(); 322 local_irq_disable();
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 17523a0abf66..62e82c25c583 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -313,7 +313,7 @@ int generic_cpu_disable(void)
313 set_cpu_online(cpu, false); 313 set_cpu_online(cpu, false);
314#ifdef CONFIG_PPC64 314#ifdef CONFIG_PPC64
315 vdso_data->processorCount--; 315 vdso_data->processorCount--;
316 fixup_irqs(cpu_online_map); 316 fixup_irqs(cpu_online_mask);
317#endif 317#endif
318 return 0; 318 return 0;
319} 319}
@@ -333,7 +333,7 @@ int generic_cpu_enable(unsigned int cpu)
333 cpu_relax(); 333 cpu_relax();
334 334
335#ifdef CONFIG_PPC64 335#ifdef CONFIG_PPC64
336 fixup_irqs(cpu_online_map); 336 fixup_irqs(cpu_online_mask);
337 /* counter the irq disable in fixup_irqs */ 337 /* counter the irq disable in fixup_irqs */
338 local_irq_enable(); 338 local_irq_enable();
339#endif 339#endif