aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2011-05-10 15:29:10 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-05-19 00:30:46 -0400
commitf1072939b6dd01d038d47db0bdc01b33e5f90f28 (patch)
tree281747826833d254131a44bad9c954659137a5a8 /arch/powerpc/sysdev
parente04763713286b1e00e1c2a33fe2741caf9470f2b (diff)
powerpc: Remove checks for MSG_ALL and MSG_ALL_BUT_SELF
Now that smp_ops->smp_message_pass is always called with an (online) cpu number for the target remove the checks for MSG_ALL and MSG_ALL_BUT_SELF. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r--arch/powerpc/sysdev/mpic.c20
-rw-r--r--arch/powerpc/sysdev/xics/icp-hv.c18
-rw-r--r--arch/powerpc/sysdev/xics/icp-native.c18
3 files changed, 4 insertions, 52 deletions
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 116695b7a5cb..68ea50c41902 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1628,31 +1628,15 @@ static void mpic_send_ipi(unsigned int ipi_no, const struct cpumask *cpu_mask)
1628 mpic_physmask(cpumask_bits(cpu_mask)[0])); 1628 mpic_physmask(cpumask_bits(cpu_mask)[0]));
1629} 1629}
1630 1630
1631void smp_mpic_message_pass(int target, int msg) 1631void smp_mpic_message_pass(int cpu, int msg)
1632{ 1632{
1633 cpumask_var_t tmp;
1634
1635 /* make sure we're sending something that translates to an IPI */ 1633 /* make sure we're sending something that translates to an IPI */
1636 if ((unsigned int)msg > 3) { 1634 if ((unsigned int)msg > 3) {
1637 printk("SMP %d: smp_message_pass: unknown msg %d\n", 1635 printk("SMP %d: smp_message_pass: unknown msg %d\n",
1638 smp_processor_id(), msg); 1636 smp_processor_id(), msg);
1639 return; 1637 return;
1640 } 1638 }
1641 switch (target) { 1639 mpic_send_ipi(msg, cpumask_of(cpu));
1642 case MSG_ALL:
1643 mpic_send_ipi(msg, cpu_online_mask);
1644 break;
1645 case MSG_ALL_BUT_SELF:
1646 alloc_cpumask_var(&tmp, GFP_NOWAIT);
1647 cpumask_andnot(tmp, cpu_online_mask,
1648 cpumask_of(smp_processor_id()));
1649 mpic_send_ipi(msg, tmp);
1650 free_cpumask_var(tmp);
1651 break;
1652 default:
1653 mpic_send_ipi(msg, cpumask_of(target));
1654 break;
1655 }
1656} 1640}
1657 1641
1658int __init smp_mpic_probe(void) 1642int __init smp_mpic_probe(void)
diff --git a/arch/powerpc/sysdev/xics/icp-hv.c b/arch/powerpc/sysdev/xics/icp-hv.c
index 76e87245bbfe..234764c189a4 100644
--- a/arch/powerpc/sysdev/xics/icp-hv.c
+++ b/arch/powerpc/sysdev/xics/icp-hv.c
@@ -118,7 +118,7 @@ static void icp_hv_set_cpu_priority(unsigned char cppr)
118 118
119#ifdef CONFIG_SMP 119#ifdef CONFIG_SMP
120 120
121static inline void icp_hv_do_message(int cpu, int msg) 121static void icp_hv_message_pass(int cpu, int msg)
122{ 122{
123 unsigned long *tgt = &per_cpu(xics_ipi_message, cpu); 123 unsigned long *tgt = &per_cpu(xics_ipi_message, cpu);
124 124
@@ -127,22 +127,6 @@ static inline void icp_hv_do_message(int cpu, int msg)
127 icp_hv_set_qirr(cpu, IPI_PRIORITY); 127 icp_hv_set_qirr(cpu, IPI_PRIORITY);
128} 128}
129 129
130static void icp_hv_message_pass(int target, int msg)
131{
132 unsigned int i;
133
134 if (target < NR_CPUS) {
135 icp_hv_do_message(target, msg);
136 } else {
137 for_each_online_cpu(i) {
138 if (target == MSG_ALL_BUT_SELF
139 && i == smp_processor_id())
140 continue;
141 icp_hv_do_message(i, msg);
142 }
143 }
144}
145
146static irqreturn_t icp_hv_ipi_action(int irq, void *dev_id) 130static irqreturn_t icp_hv_ipi_action(int irq, void *dev_id)
147{ 131{
148 int cpu = smp_processor_id(); 132 int cpu = smp_processor_id();
diff --git a/arch/powerpc/sysdev/xics/icp-native.c b/arch/powerpc/sysdev/xics/icp-native.c
index 3508321c4501..246500eefbfd 100644
--- a/arch/powerpc/sysdev/xics/icp-native.c
+++ b/arch/powerpc/sysdev/xics/icp-native.c
@@ -134,7 +134,7 @@ static unsigned int icp_native_get_irq(void)
134 134
135#ifdef CONFIG_SMP 135#ifdef CONFIG_SMP
136 136
137static inline void icp_native_do_message(int cpu, int msg) 137static void icp_native_message_pass(int cpu, int msg)
138{ 138{
139 unsigned long *tgt = &per_cpu(xics_ipi_message, cpu); 139 unsigned long *tgt = &per_cpu(xics_ipi_message, cpu);
140 140
@@ -143,22 +143,6 @@ static inline void icp_native_do_message(int cpu, int msg)
143 icp_native_set_qirr(cpu, IPI_PRIORITY); 143 icp_native_set_qirr(cpu, IPI_PRIORITY);
144} 144}
145 145
146static void icp_native_message_pass(int target, int msg)
147{
148 unsigned int i;
149
150 if (target < NR_CPUS) {
151 icp_native_do_message(target, msg);
152 } else {
153 for_each_online_cpu(i) {
154 if (target == MSG_ALL_BUT_SELF
155 && i == smp_processor_id())
156 continue;
157 icp_native_do_message(i, msg);
158 }
159 }
160}
161
162static irqreturn_t icp_native_ipi_action(int irq, void *dev_id) 146static irqreturn_t icp_native_ipi_action(int irq, void *dev_id)
163{ 147{
164 int cpu = smp_processor_id(); 148 int cpu = smp_processor_id();