aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2008-12-13 05:50:26 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-12-13 05:50:26 -0500
commit0de26520c7cabf36e1de090ea8092f011a6106ce (patch)
tree3d02e509b6315fdfd9cdb8c9e0b9ed0a30cf9384 /arch/powerpc
parent29c0177e6a4ac094302bed54a1d4bbb6b740a9ef (diff)
cpumask: make irq_set_affinity() take a const struct cpumask
Impact: change existing irq_chip API Not much point with gentle transition here: the struct irq_chip's setaffinity method signature needs to change. Fortunately, not widely used code, but hits a few architectures. Note: In irq_select_affinity() I save a temporary in by mangling irq_desc[irq].affinity directly. Ingo, does this break anything? (Folded in fix from KOSAKI Motohiro) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com> Reviewed-by: Grant Grundler <grundler@parisc-linux.org> Acked-by: Ingo Molnar <mingo@redhat.com> Cc: ralf@linux-mips.org Cc: grundler@parisc-linux.org Cc: jeremy@xensource.com Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/irq.c2
-rw-r--r--arch/powerpc/platforms/pseries/xics.c6
-rw-r--r--arch/powerpc/sysdev/mpic.c4
-rw-r--r--arch/powerpc/sysdev/mpic.h2
4 files changed, 7 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index ac222d0ab12e..23b8b5e36f98 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -237,7 +237,7 @@ void fixup_irqs(cpumask_t map)
237 mask = map; 237 mask = map;
238 } 238 }
239 if (irq_desc[irq].chip->set_affinity) 239 if (irq_desc[irq].chip->set_affinity)
240 irq_desc[irq].chip->set_affinity(irq, mask); 240 irq_desc[irq].chip->set_affinity(irq, &mask);
241 else if (irq_desc[irq].action && !(warned++)) 241 else if (irq_desc[irq].action && !(warned++))
242 printk("Cannot set affinity for irq %i\n", irq); 242 printk("Cannot set affinity for irq %i\n", irq);
243 } 243 }
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index 64d24310ce7e..424b335a71c8 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -332,7 +332,7 @@ static void xics_eoi_lpar(unsigned int virq)
332 lpar_xirr_info_set((0xff << 24) | irq); 332 lpar_xirr_info_set((0xff << 24) | irq);
333} 333}
334 334
335static void xics_set_affinity(unsigned int virq, cpumask_t cpumask) 335static void xics_set_affinity(unsigned int virq, const struct cpumask *cpumask)
336{ 336{
337 unsigned int irq; 337 unsigned int irq;
338 int status; 338 int status;
@@ -358,7 +358,7 @@ static void xics_set_affinity(unsigned int virq, cpumask_t cpumask)
358 irq_server = get_irq_server(virq, 1); 358 irq_server = get_irq_server(virq, 1);
359 if (irq_server == -1) { 359 if (irq_server == -1) {
360 char cpulist[128]; 360 char cpulist[128];
361 cpumask_scnprintf(cpulist, sizeof(cpulist), &cpumask); 361 cpumask_scnprintf(cpulist, sizeof(cpulist), cpumask);
362 printk(KERN_WARNING 362 printk(KERN_WARNING
363 "%s: No online cpus in the mask %s for irq %d\n", 363 "%s: No online cpus in the mask %s for irq %d\n",
364 __func__, cpulist, virq); 364 __func__, cpulist, virq);
@@ -845,7 +845,7 @@ void xics_migrate_irqs_away(void)
845 845
846 /* Reset affinity to all cpus */ 846 /* Reset affinity to all cpus */
847 irq_desc[virq].affinity = CPU_MASK_ALL; 847 irq_desc[virq].affinity = CPU_MASK_ALL;
848 desc->chip->set_affinity(virq, CPU_MASK_ALL); 848 desc->chip->set_affinity(virq, cpu_all_mask);
849unlock: 849unlock:
850 spin_unlock_irqrestore(&desc->lock, flags); 850 spin_unlock_irqrestore(&desc->lock, flags);
851 } 851 }
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 1890fb085cde..5d7f9f0c93c3 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -817,7 +817,7 @@ static void mpic_end_ipi(unsigned int irq)
817 817
818#endif /* CONFIG_SMP */ 818#endif /* CONFIG_SMP */
819 819
820void mpic_set_affinity(unsigned int irq, cpumask_t cpumask) 820void mpic_set_affinity(unsigned int irq, const struct cpumask *cpumask)
821{ 821{
822 struct mpic *mpic = mpic_from_irq(irq); 822 struct mpic *mpic = mpic_from_irq(irq);
823 unsigned int src = mpic_irq_to_hw(irq); 823 unsigned int src = mpic_irq_to_hw(irq);
@@ -829,7 +829,7 @@ void mpic_set_affinity(unsigned int irq, cpumask_t cpumask)
829 } else { 829 } else {
830 cpumask_t tmp; 830 cpumask_t tmp;
831 831
832 cpus_and(tmp, cpumask, cpu_online_map); 832 cpumask_and(&tmp, cpumask, cpu_online_mask);
833 833
834 mpic_irq_write(src, MPIC_INFO(IRQ_DESTINATION), 834 mpic_irq_write(src, MPIC_INFO(IRQ_DESTINATION),
835 mpic_physmask(cpus_addr(tmp)[0])); 835 mpic_physmask(cpus_addr(tmp)[0]));
diff --git a/arch/powerpc/sysdev/mpic.h b/arch/powerpc/sysdev/mpic.h
index 6209c62a426d..3cef2af10f42 100644
--- a/arch/powerpc/sysdev/mpic.h
+++ b/arch/powerpc/sysdev/mpic.h
@@ -36,6 +36,6 @@ static inline int mpic_pasemi_msi_init(struct mpic *mpic)
36 36
37extern int mpic_set_irq_type(unsigned int virq, unsigned int flow_type); 37extern int mpic_set_irq_type(unsigned int virq, unsigned int flow_type);
38extern void mpic_set_vector(unsigned int virq, unsigned int vector); 38extern void mpic_set_vector(unsigned int virq, unsigned int vector);
39extern void mpic_set_affinity(unsigned int irq, cpumask_t cpumask); 39extern void mpic_set_affinity(unsigned int irq, const struct cpumask *cpumask);
40 40
41#endif /* _POWERPC_SYSDEV_MPIC_H */ 41#endif /* _POWERPC_SYSDEV_MPIC_H */