Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 567ebfc9 authored by Sonic Zhang's avatar Sonic Zhang Committed by Mike Frysinger
Browse files

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: default avatarSonic Zhang <sonic.zhang@analog.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
parent ab61d2ac
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -244,13 +244,14 @@ 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);

	preempt_enable();

	return 0;
}
EXPORT_SYMBOL_GPL(smp_call_function);
@@ -286,13 +287,14 @@ 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);

	preempt_enable();

	return;
}