aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--arch/powerpc/include/asm/dbell.h2
-rw-r--r--arch/powerpc/include/asm/machdep.h2
-rw-r--r--arch/powerpc/include/asm/xics.h2
-rw-r--r--arch/powerpc/kernel/dbell.c29
-rw-r--r--arch/powerpc/platforms/cell/beat_smp.c18
-rw-r--r--arch/powerpc/platforms/cell/smp.c18
-rw-r--r--arch/powerpc/platforms/iseries/smp.c18
-rw-r--r--arch/powerpc/platforms/powermac/smp.c17
-rw-r--r--arch/powerpc/platforms/ps3/smp.c22
-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
12 files changed, 21 insertions, 163 deletions
diff --git a/arch/powerpc/include/asm/dbell.h b/arch/powerpc/include/asm/dbell.h
index 0893ab9343a6..3269eb49640a 100644
--- a/arch/powerpc/include/asm/dbell.h
+++ b/arch/powerpc/include/asm/dbell.h
@@ -27,7 +27,7 @@ enum ppc_dbell {
27 PPC_G_DBELL_MC = 4, /* guest mcheck doorbell */ 27 PPC_G_DBELL_MC = 4, /* guest mcheck doorbell */
28}; 28};
29 29
30extern void doorbell_message_pass(int target, int msg); 30extern void doorbell_message_pass(int cpu, int msg);
31extern void doorbell_exception(struct pt_regs *regs); 31extern void doorbell_exception(struct pt_regs *regs);
32extern void doorbell_check_self(void); 32extern void doorbell_check_self(void);
33extern void doorbell_setup_this_cpu(void); 33extern void doorbell_setup_this_cpu(void);
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index c6345acf166f..b0802a5bd744 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -31,7 +31,7 @@ struct kimage;
31 31
32#ifdef CONFIG_SMP 32#ifdef CONFIG_SMP
33struct smp_ops_t { 33struct smp_ops_t {
34 void (*message_pass)(int target, int msg); 34 void (*message_pass)(int cpu, int msg);
35 int (*probe)(void); 35 int (*probe)(void);
36 int (*kick_cpu)(int nr); 36 int (*kick_cpu)(int nr);
37 void (*setup_cpu)(int nr); 37 void (*setup_cpu)(int nr);
diff --git a/arch/powerpc/include/asm/xics.h b/arch/powerpc/include/asm/xics.h
index 6c06306c4100..1750c8dae1fa 100644
--- a/arch/powerpc/include/asm/xics.h
+++ b/arch/powerpc/include/asm/xics.h
@@ -40,7 +40,7 @@ struct icp_ops {
40 void (*teardown_cpu)(void); 40 void (*teardown_cpu)(void);
41 void (*flush_ipi)(void); 41 void (*flush_ipi)(void);
42#ifdef CONFIG_SMP 42#ifdef CONFIG_SMP
43 void (*message_pass)(int target, int msg); 43 void (*message_pass)(int cpu, int msg);
44 irq_handler_t ipi_action; 44 irq_handler_t ipi_action;
45#endif 45#endif
46}; 46};
diff --git a/arch/powerpc/kernel/dbell.c b/arch/powerpc/kernel/dbell.c
index 3307a52d797f..e49b24c84133 100644
--- a/arch/powerpc/kernel/dbell.c
+++ b/arch/powerpc/kernel/dbell.c
@@ -34,32 +34,13 @@ void doorbell_setup_this_cpu(void)
34 info->tag = mfspr(SPRN_PIR) & 0x3fff; 34 info->tag = mfspr(SPRN_PIR) & 0x3fff;
35} 35}
36 36
37void doorbell_message_pass(int target, int msg) 37void doorbell_message_pass(int cpu, int msg)
38{ 38{
39 struct doorbell_cpu_info *info; 39 struct doorbell_cpu_info *info;
40 int i; 40
41 41 info = &per_cpu(doorbell_cpu_info, cpu);
42 if (target < NR_CPUS) { 42 set_bit(msg, &info->messages);
43 info = &per_cpu(doorbell_cpu_info, target); 43 ppc_msgsnd(PPC_DBELL, 0, info->tag);
44 set_bit(msg, &info->messages);
45 ppc_msgsnd(PPC_DBELL, 0, info->tag);
46 }
47 else if (target == MSG_ALL_BUT_SELF) {
48 for_each_online_cpu(i) {
49 if (i == smp_processor_id())
50 continue;
51 info = &per_cpu(doorbell_cpu_info, i);
52 set_bit(msg, &info->messages);
53 ppc_msgsnd(PPC_DBELL, 0, info->tag);
54 }
55 }
56 else { /* target == MSG_ALL */
57 for_each_online_cpu(i) {
58 info = &per_cpu(doorbell_cpu_info, i);
59 set_bit(msg, &info->messages);
60 }
61 ppc_msgsnd(PPC_DBELL, PPC_DBELL_MSG_BRDCAST, 0);
62 }
63} 44}
64 45
65void doorbell_exception(struct pt_regs *regs) 46void doorbell_exception(struct pt_regs *regs)
diff --git a/arch/powerpc/platforms/cell/beat_smp.c b/arch/powerpc/platforms/cell/beat_smp.c
index 3e86acbb0fb4..23bbe6e08c87 100644
--- a/arch/powerpc/platforms/cell/beat_smp.c
+++ b/arch/powerpc/platforms/cell/beat_smp.c
@@ -67,22 +67,6 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu)
67 return 0; 67 return 0;
68} 68}
69 69
70static void smp_beatic_message_pass(int target, int msg)
71{
72 unsigned int i;
73
74 if (target < NR_CPUS) {
75 beatic_cause_IPI(target, msg);
76 } else {
77 for_each_online_cpu(i) {
78 if (target == MSG_ALL_BUT_SELF
79 && i == smp_processor_id())
80 continue;
81 beatic_cause_IPI(i, msg);
82 }
83 }
84}
85
86static int __init smp_beatic_probe(void) 70static int __init smp_beatic_probe(void)
87{ 71{
88 return cpumask_weight(cpu_possible_mask); 72 return cpumask_weight(cpu_possible_mask);
@@ -105,7 +89,7 @@ static int smp_celleb_cpu_bootable(unsigned int nr)
105 return 1; 89 return 1;
106} 90}
107static struct smp_ops_t bpa_beatic_smp_ops = { 91static struct smp_ops_t bpa_beatic_smp_ops = {
108 .message_pass = smp_beatic_message_pass, 92 .message_pass = beatic_cause_IPI,
109 .probe = smp_beatic_probe, 93 .probe = smp_beatic_probe,
110 .kick_cpu = smp_celleb_kick_cpu, 94 .kick_cpu = smp_celleb_kick_cpu,
111 .setup_cpu = smp_beatic_setup_cpu, 95 .setup_cpu = smp_beatic_setup_cpu,
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c
index a2161b91b0bf..d176e6148e3f 100644
--- a/arch/powerpc/platforms/cell/smp.c
+++ b/arch/powerpc/platforms/cell/smp.c
@@ -103,22 +103,6 @@ static inline int __devinit smp_startup_cpu(unsigned int lcpu)
103 return 1; 103 return 1;
104} 104}
105 105
106static void smp_iic_message_pass(int target, int msg)
107{
108 unsigned int i;
109
110 if (target < NR_CPUS) {
111 iic_cause_IPI(target, msg);
112 } else {
113 for_each_online_cpu(i) {
114 if (target == MSG_ALL_BUT_SELF
115 && i == smp_processor_id())
116 continue;
117 iic_cause_IPI(i, msg);
118 }
119 }
120}
121
122static int __init smp_iic_probe(void) 106static int __init smp_iic_probe(void)
123{ 107{
124 iic_request_IPIs(); 108 iic_request_IPIs();
@@ -168,7 +152,7 @@ static int smp_cell_cpu_bootable(unsigned int nr)
168 return 1; 152 return 1;
169} 153}
170static struct smp_ops_t bpa_iic_smp_ops = { 154static struct smp_ops_t bpa_iic_smp_ops = {
171 .message_pass = smp_iic_message_pass, 155 .message_pass = iic_cause_IPI,
172 .probe = smp_iic_probe, 156 .probe = smp_iic_probe,
173 .kick_cpu = smp_cell_kick_cpu, 157 .kick_cpu = smp_cell_kick_cpu,
174 .setup_cpu = smp_cell_setup_cpu, 158 .setup_cpu = smp_cell_setup_cpu,
diff --git a/arch/powerpc/platforms/iseries/smp.c b/arch/powerpc/platforms/iseries/smp.c
index 02a677a1f912..dcdbc5dc5aad 100644
--- a/arch/powerpc/platforms/iseries/smp.c
+++ b/arch/powerpc/platforms/iseries/smp.c
@@ -59,28 +59,12 @@ void iSeries_smp_message_recv(void)
59 smp_message_recv(msg); 59 smp_message_recv(msg);
60} 60}
61 61
62static inline void smp_iSeries_do_message(int cpu, int msg) 62static void smp_iSeries_message_pass(int cpu, int msg)
63{ 63{
64 set_bit(msg, &iSeries_smp_message[cpu]); 64 set_bit(msg, &iSeries_smp_message[cpu]);
65 HvCall_sendIPI(&(paca[cpu])); 65 HvCall_sendIPI(&(paca[cpu]));