aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2010-06-25 01:55:16 -0400
committerMike Frysinger <vapier@gentoo.org>2011-03-18 04:01:02 -0400
commit567ebfc99d7546913408b560ad443a5315bf8a53 (patch)
treedce02fc76d5ef5ad08d7b0cbeec1679d4f3f5ad6 /arch/blackfin
parentab61d2ac5c9d7c9232b8455c8d889216ca9d4814 (diff)
Blackfin: SMP: disable preempt with smp_processor_id to send messages
The smp_processor_id() API requires that preempt be disabled when calling it, so make sure it is when we go to send messages to other processors. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/mach-common/smp.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c
index 40e6cbc363f5..5f7617d66905 100644
--- a/arch/blackfin/mach-common/smp.c
+++ b/arch/blackfin/mach-common/smp.c
@@ -244,12 +244,13 @@ int smp_call_function(void (*func)(void *info), void *info, int wait)
244{ 244{
245 cpumask_t callmap; 245 cpumask_t callmap;
246 246
247 preempt_disable();
247 callmap = cpu_online_map; 248 callmap = cpu_online_map;
248 cpu_clear(smp_processor_id(), callmap); 249 cpu_clear(smp_processor_id(), callmap);
249 if (cpus_empty(callmap)) 250 if (!cpus_empty(callmap))
250 return 0; 251 smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait);
251 252
252 smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait); 253 preempt_enable();
253 254
254 return 0; 255 return 0;
255} 256}
@@ -286,12 +287,13 @@ void smp_send_stop(void)
286{ 287{
287 cpumask_t callmap; 288 cpumask_t callmap;
288 289
290 preempt_disable();
289 callmap = cpu_online_map; 291 callmap = cpu_online_map;
290 cpu_clear(smp_processor_id(), callmap); 292 cpu_clear(smp_processor_id(), callmap);
291 if (cpus_empty(callmap)) 293 if (!cpus_empty(callmap))
292 return; 294 smp_send_message(callmap, BFIN_IPI_CPU_STOP, NULL, NULL, 0);
293 295
294 smp_send_message(callmap, BFIN_IPI_CPU_STOP, NULL, NULL, 0); 296 preempt_enable();
295 297
296 return; 298 return;
297} 299}