提交 567ebfc9 编写于 作者: S Sonic Zhang 提交者: Mike Frysinger

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: NSonic Zhang <sonic.zhang@analog.com>
Signed-off-by: NMike Frysinger <vapier@gentoo.org>
上级 ab61d2ac
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册