diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2010-06-25 07:55:16 +0200 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-03-18 09:01:02 +0100 |
commit | 567ebfc99d7546913408b560ad443a5315bf8a53 (patch) | |
tree | dce02fc76d5ef5ad08d7b0cbeec1679d4f3f5ad6 /arch/blackfin/mach-common | |
parent | Blackfin: SMP: delay enabling caches until CPU is initialized (diff) | |
download | linux-567ebfc99d7546913408b560ad443a5315bf8a53.tar.xz linux-567ebfc99d7546913408b560ad443a5315bf8a53.zip |
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/mach-common')
-rw-r--r-- | arch/blackfin/mach-common/smp.c | 14 |
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) { cpumask_t callmap; + preempt_disable(); callmap = cpu_online_map; cpu_clear(smp_processor_id(), callmap); - if (cpus_empty(callmap)) - return 0; + if (!cpus_empty(callmap)) + smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait); - smp_send_message(callmap, BFIN_IPI_CALL_FUNC, func, info, wait); + preempt_enable(); return 0; } @@ -286,12 +287,13 @@ void smp_send_stop(void) { cpumask_t callmap; + preempt_disable(); callmap = cpu_online_map; cpu_clear(smp_processor_id(), callmap); - if (cpus_empty(callmap)) - return; + if (!cpus_empty(callmap)) + smp_send_message(callmap, BFIN_IPI_CPU_STOP, NULL, NULL, 0); - smp_send_message(callmap, BFIN_IPI_CPU_STOP, NULL, NULL, 0); + preempt_enable(); return; } |