diff options
author | Avi Kivity <avi@qumranet.com> | 2007-07-19 11:33:48 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-07-22 07:30:58 -0400 |
commit | adff093d6c545c882f1503607f6af14ddd90bb89 (patch) | |
tree | 8d821e6de3ef05cdcbb784a1493a91b5bc8e5dd6 /arch/powerpc/kernel/smp.c | |
parent | 08ae6cc15db201fa20cc4893d9500c1f6b20e560 (diff) |
[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.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/smp.c')
-rw-r--r-- | arch/powerpc/kernel/smp.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index d577b71db375..087c92f2a3eb 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
@@ -284,7 +284,7 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int | |||
284 | int wait) | 284 | int wait) |
285 | { | 285 | { |
286 | cpumask_t map = CPU_MASK_NONE; | 286 | cpumask_t map = CPU_MASK_NONE; |
287 | int ret = -EBUSY; | 287 | int ret = 0; |
288 | 288 | ||
289 | if (!cpu_online(cpu)) | 289 | if (!cpu_online(cpu)) |
290 | return -EINVAL; | 290 | return -EINVAL; |
@@ -292,6 +292,11 @@ int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int | |||
292 | cpu_set(cpu, map); | 292 | cpu_set(cpu, map); |
293 | if (cpu != get_cpu()) | 293 | if (cpu != get_cpu()) |
294 | ret = smp_call_function_map(func,info,nonatomic,wait,map); | 294 | ret = smp_call_function_map(func,info,nonatomic,wait,map); |
295 | else { | ||
296 | local_irq_disable(); | ||
297 | func(info); | ||
298 | local_irq_enable(); | ||
299 | } | ||
295 | put_cpu(); | 300 | put_cpu(); |
296 | return ret; | 301 | return ret; |
297 | } | 302 | } |