diff options
-rw-r--r-- | arch/powerpc/include/asm/dbell.h | 2 | ||||
-rw-r--r-- | arch/powerpc/include/asm/machdep.h | 2 | ||||
-rw-r--r-- | arch/powerpc/include/asm/xics.h | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/dbell.c | 29 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/beat_smp.c | 18 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/smp.c | 18 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/smp.c | 18 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/smp.c | 17 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/smp.c | 22 | ||||
-rw-r--r-- | arch/powerpc/sysdev/mpic.c | 20 | ||||
-rw-r--r-- | arch/powerpc/sysdev/xics/icp-hv.c | 18 | ||||
-rw-r--r-- | arch/powerpc/sysdev/xics/icp-native.c | 18 |
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 | ||
30 | extern void doorbell_message_pass(int target, int msg); | 30 | extern void doorbell_message_pass(int cpu, int msg); |
31 | extern void doorbell_exception(struct pt_regs *regs); | 31 | extern void doorbell_exception(struct pt_regs *regs); |
32 | extern void doorbell_check_self(void); | 32 | extern void doorbell_check_self(void); |
33 | extern void doorbell_setup_this_cpu(void); | 33 | extern 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 |
33 | struct smp_ops_t { | 33 | struct 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 | ||
37 | void doorbell_message_pass(int target, int msg) | 37 | void 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 | ||
65 | void doorbell_exception(struct pt_regs *regs) | 46 | void 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 | ||
70 | static 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 | |||
86 | static int __init smp_beatic_probe(void) | 70 | static 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 | } |
107 | static struct smp_ops_t bpa_beatic_smp_ops = { | 91 | static 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 | ||
106 | static 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 | |||
122 | static int __init smp_iic_probe(void) | 106 | static 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 | } |
170 | static struct smp_ops_t bpa_iic_smp_ops = { | 154 | static 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 | ||
62 | static inline void smp_iSeries_do_message(int cpu, int msg) | 62 | static 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])); |
66 | } | 66 | } |
67 | 67 | ||
68 | static void smp_iSeries_message_pass(int target, int msg) | ||
69 | { | ||
70 | int i; | ||
71 | |||
72 | if (target < NR_CPUS) | ||
73 | smp_iSeries_do_message(target, msg); | ||
74 | else { | ||
75 | for_each_online_cpu(i) { | ||
76 | if ((target == MSG_ALL_BUT_SELF) && | ||
77 | (i == smp_processor_id())) | ||
78 | continue; | ||
79 | smp_iSeries_do_message(i, msg); | ||
80 | } | ||
81 | } | ||
82 | } | ||
83 | |||
84 | static int smp_iSeries_probe(void) | 68 | static int smp_iSeries_probe(void) |
85 | { | 69 | { |
86 | return cpumask_weight(cpu_possible_mask); | 70 | return cpumask_weight(cpu_possible_mask); |
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c index 621d4b7755f2..c49e71926a54 100644 --- a/arch/powerpc/platforms/powermac/smp.c +++ b/arch/powerpc/platforms/powermac/smp.c | |||
@@ -186,21 +186,10 @@ irqreturn_t psurge_primary_intr(int irq, void *d) | |||
186 | return IRQ_HANDLED; | 186 | return IRQ_HANDLED; |
187 | } | 187 | } |
188 | 188 | ||
189 | static void smp_psurge_message_pass(int target, int msg) | 189 | static void smp_psurge_message_pass(int cpu, int msg) |
190 | { | 190 | { |
191 | int i; | 191 | set_bit(msg, &psurge_smp_message[cpu]); |
192 | 192 | psurge_set_ipi(cpu); | |
193 | if (num_online_cpus() < 2) | ||
194 | return; | ||
195 | |||
196 | for_each_online_cpu(i) { | ||
197 | if (target == MSG_ALL | ||
198 | || (target == MSG_ALL_BUT_SELF && i != smp_processor_id()) | ||
199 | || target == i) { | ||
200 | set_bit(msg, &psurge_smp_message[i]); | ||
201 | psurge_set_ipi(i); | ||
202 | } | ||
203 | } | ||
204 | } | 193 | } |
205 | 194 | ||
206 | /* | 195 | /* |
diff --git a/arch/powerpc/platforms/ps3/smp.c b/arch/powerpc/platforms/ps3/smp.c index 51ffde40af2b..4c44794faac0 100644 --- a/arch/powerpc/platforms/ps3/smp.c +++ b/arch/powerpc/platforms/ps3/smp.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #define MSG_COUNT 4 | 39 | #define MSG_COUNT 4 |
40 | static DEFINE_PER_CPU(unsigned int [MSG_COUNT], ps3_ipi_virqs); | 40 | static DEFINE_PER_CPU(unsigned int [MSG_COUNT], ps3_ipi_virqs); |
41 | 41 | ||
42 | static void do_message_pass(int target, int msg) | 42 | static void ps3_smp_message_pass(int cpu, int msg) |
43 | { | 43 | { |
44 | int result; | 44 | int result; |
45 | unsigned int virq; | 45 | unsigned int virq; |
@@ -49,28 +49,12 @@ static void do_message_pass(int target, int msg) | |||
49 | return; | 49 | return; |
50 | } | 50 | } |
51 | 51 | ||
52 | virq = per_cpu(ps3_ipi_virqs, target)[msg]; | 52 | virq = per_cpu(ps3_ipi_virqs, cpu)[msg]; |
53 | result = ps3_send_event_locally(virq); | 53 | result = ps3_send_event_locally(virq); |
54 | 54 | ||
55 | if (result) | 55 | if (result) |
56 | DBG("%s:%d: ps3_send_event_locally(%d, %d) failed" | 56 | DBG("%s:%d: ps3_send_event_locally(%d, %d) failed" |
57 | " (%d)\n", __func__, __LINE__, target, msg, result); | 57 | " (%d)\n", __func__, __LINE__, cpu, msg, result); |
58 | } | ||
59 | |||
60 | static void ps3_smp_message_pass(int target, int msg) | ||
61 | { | ||
62 | int cpu; | ||
63 | |||
64 | if (target < NR_CPUS) | ||
65 | do_message_pass(target, msg); | ||
66 | else if (target == MSG_ALL_BUT_SELF) { | ||
67 | for_each_online_cpu(cpu) | ||
68 | if (cpu != smp_processor_id()) | ||
69 | do_message_pass(cpu, msg); | ||
70 | } else { | ||
71 | for_each_online_cpu(cpu) | ||
72 | do_message_pass(cpu, msg); | ||
73 | } | ||
74 | } | 58 | } |
75 | 59 | ||
76 | static int ps3_smp_probe(void) | 60 | static int ps3_smp_probe(void) |
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 | ||
1631 | void smp_mpic_message_pass(int target, int msg) | 1631 | void 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 | ||
1658 | int __init smp_mpic_probe(void) | 1642 | int __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 | ||
121 | static inline void icp_hv_do_message(int cpu, int msg) | 121 | static 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 | ||
130 | static 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 | |||
146 | static irqreturn_t icp_hv_ipi_action(int irq, void *dev_id) | 130 | static 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 | ||
137 | static inline void icp_native_do_message(int cpu, int msg) | 137 | static 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 | ||
146 | static 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 | |||
162 | static irqreturn_t icp_native_ipi_action(int irq, void *dev_id) | 146 | static 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(); |