Skip to contentSkip to conversation

powerpc: Allow smp_call_function_single() to current cpu

PATCH New Avi Kivity 1 participant 1 message Jul 19, 2007

Subsystems (2)
lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/1 powerpc: Allow smp_call_function_single() to current cpu

This removes the requirement for callers to get_cpu() to check in simple cases. i386 and x86_64 already received a similar treatment.

---
 arch/powerpc/kernel/smp.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
arch/powerpc/kernel/smp.c +6 -1
index d577b71..087c92f 100644
@@ -284,7 +284,7 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int
 			int wait)
 {
 	cpumask_t map = CPU_MASK_NONE;
-	int ret = -EBUSY;
+	int ret = 0;
 
 	if (!cpu_online(cpu))
 		return -EINVAL;
@@ -292,6 +292,11 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int
 	cpu_set(cpu, map);
 	if (cpu != get_cpu())
 		ret = smp_call_function_map(func,info,nonatomic,wait,map);
+	else {
+		local_irq_disable();
+		func(info);
+		local_irq_enable();
+	}
 	put_cpu();
 	return ret;
 }
Signature · 7 lines
1.5.2.4


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/