diff options
Diffstat (limited to 'arch/blackfin/mach-common/smp.c')
-rw-r--r-- | arch/blackfin/mach-common/smp.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c index 1fbd94c44457..35e7e1eb0188 100644 --- a/arch/blackfin/mach-common/smp.c +++ b/arch/blackfin/mach-common/smp.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <asm/atomic.h> | 26 | #include <asm/atomic.h> |
27 | #include <asm/cacheflush.h> | 27 | #include <asm/cacheflush.h> |
28 | #include <asm/irq_handler.h> | ||
28 | #include <asm/mmu_context.h> | 29 | #include <asm/mmu_context.h> |
29 | #include <asm/pgtable.h> | 30 | #include <asm/pgtable.h> |
30 | #include <asm/pgalloc.h> | 31 | #include <asm/pgalloc.h> |
@@ -96,7 +97,7 @@ static void ipi_cpu_stop(unsigned int cpu) | |||
96 | dump_stack(); | 97 | dump_stack(); |
97 | spin_unlock(&stop_lock); | 98 | spin_unlock(&stop_lock); |
98 | 99 | ||
99 | cpu_clear(cpu, cpu_online_map); | 100 | set_cpu_online(cpu, false); |
100 | 101 | ||
101 | local_irq_disable(); | 102 | local_irq_disable(); |
102 | 103 | ||
@@ -146,7 +147,7 @@ static void ipi_call_function(unsigned int cpu, struct ipi_message *msg) | |||
146 | */ | 147 | */ |
147 | resync_core_dcache(); | 148 | resync_core_dcache(); |
148 | #endif | 149 | #endif |
149 | cpu_clear(cpu, *msg->call_struct.waitmask); | 150 | cpumask_clear_cpu(cpu, msg->call_struct.waitmask); |
150 | } | 151 | } |
151 | } | 152 | } |
152 | 153 | ||
@@ -222,9 +223,10 @@ static inline void smp_send_message(cpumask_t callmap, unsigned long type, | |||
222 | struct ipi_message_queue *msg_queue; | 223 | struct ipi_message_queue *msg_queue; |
223 | struct ipi_message *msg; | 224 | struct ipi_message *msg; |
224 | unsigned long flags, next_msg; | 225 | unsigned long flags, next_msg; |
225 | cpumask_t waitmask = callmap; /* waitmask is shared by all cpus */ | 226 | cpumask_t waitmask; /* waitmask is shared by all cpus */ |
226 | 227 | ||
227 | for_each_cpu_mask(cpu, callmap) { | 228 | cpumask_copy(&waitmask, &callmap); |
229 | for_each_cpu(cpu, &callmap) { | ||
228 | msg_queue = &per_cpu(ipi_msg_queue, cpu); | 230 | msg_queue = &per_cpu(ipi_msg_queue, cpu); |
229 | spin_lock_irqsave(&msg_queue->lock, flags); | 231 | spin_lock_irqsave(&msg_queue->lock, flags); |
230 | if (msg_queue->count < BFIN_IPI_MSGQ_LEN) { | 232 | if (msg_queue->count < BFIN_IPI_MSGQ_LEN) { |
@@ -246,7 +248,7 @@ static inline void smp_send_message(cpumask_t callmap, unsigned long type, | |||
246 | } | 248 | } |
247 | 249 | ||
248 | if (wait) { | 250 | if (wait) { |
249 | while (!cpus_empty(waitmask)) | 251 | while (!cpumask_empty(&waitmask)) |
250 | blackfin_dcache_invalidate_range( | 252 | blackfin_dcache_invalidate_range( |
251 | (unsigned long)(&waitmask), | 253 | (unsigned long)(&waitmask), |
252 | (unsigned long)(&waitmask)); | 254 | (unsigned long)(&waitmask)); |
@@ -265,9 +267,9 @@ int smp_call_function(void (*func)(void *info), void *info, int wait) | |||
265 | cpumask_t callmap; | 267 | cpumask_t callmap; |
266 | 268 | ||
267 | preempt_disable(); | 269 | preempt_disable(); |
268 | callmap = cpu_online_map; | 270 | cpumask_copy(&callmap, cpu_online_mask); |
269 | cpu_clear(smp_processor_id(), callmap); | 271 | cpumask_clear_cpu(smp_processor_id(), &callmap); |
270 | if (!cpus_empty(callmap)) | 272 | if (!cpumask_empty(&callmap)) |
271 | smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait); | 273 | smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait); |
272 | 274 | ||
273 | preempt_enable(); | 275 | preempt_enable(); |
@@ -284,8 +286,8 @@ int smp_call_function_single(int cpuid, void (*func) (void *info), void *info, | |||
284 | 286 | ||
285 | if (cpu_is_offline(cpu)) | 287 | if (cpu_is_offline(cpu)) |
286 | return 0; | 288 | return 0; |
287 | cpus_clear(callmap); | 289 | cpumask_clear(&callmap); |
288 | cpu_set(cpu, callmap); | 290 | cpumask_set_cpu(cpu, &callmap); |
289 | 291 | ||
290 | smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait); | 292 | smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait); |
291 | 293 | ||
@@ -308,9 +310,9 @@ void smp_send_stop(void) | |||
308 | cpumask_t callmap; | 310 | cpumask_t callmap; |
309 | 311 | ||
310 | preempt_disable(); | 312 | preempt_disable(); |
311 | callmap = cpu_online_map; | 313 | cpumask_copy(&callmap, cpu_online_mask); |
312 | cpu_clear(smp_processor_id(), callmap); | 314 | cpumask_clear_cpu(smp_processor_id(), &callmap); |
313 | if (!cpus_empty(callmap)) | 315 | if (!cpumask_empty(&callmap)) |
314 | smp_send_message(callmap, BFIN_IPI_CPU_STOP, NULL, NULL, 0); | 316 | smp_send_message(callmap, BFIN_IPI_CPU_STOP, NULL, NULL, 0); |
315 | 317 | ||
316 | preempt_enable(); | 318 | preempt_enable(); |