diff options
-rw-r--r-- | arch/x86_64/kernel/smp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c index 2ff468591625..0694940b2e73 100644 --- a/arch/x86_64/kernel/smp.c +++ b/arch/x86_64/kernel/smp.c | |||
@@ -357,7 +357,7 @@ __smp_call_function_single(int cpu, void (*func) (void *info), void *info, | |||
357 | } | 357 | } |
358 | 358 | ||
359 | /* | 359 | /* |
360 | * smp_call_function_single - Run a function on another CPU | 360 | * smp_call_function_single - Run a function on a specific CPU |
361 | * @func: The function to run. This must be fast and non-blocking. | 361 | * @func: The function to run. This must be fast and non-blocking. |
362 | * @info: An arbitrary pointer to pass to the function. | 362 | * @info: An arbitrary pointer to pass to the function. |
363 | * @nonatomic: Currently unused. | 363 | * @nonatomic: Currently unused. |
@@ -374,14 +374,18 @@ int smp_call_function_single (int cpu, void (*func) (void *info), void *info, | |||
374 | { | 374 | { |
375 | /* prevent preemption and reschedule on another processor */ | 375 | /* prevent preemption and reschedule on another processor */ |
376 | int me = get_cpu(); | 376 | int me = get_cpu(); |
377 | |||
378 | /* Can deadlock when called with interrupts disabled */ | ||
379 | WARN_ON(irqs_disabled()); | ||
380 | |||
377 | if (cpu == me) { | 381 | if (cpu == me) { |
382 | local_irq_disable(); | ||
383 | func(info); | ||
384 | local_irq_enable(); | ||
378 | put_cpu(); | 385 | put_cpu(); |
379 | return 0; | 386 | return 0; |
380 | } | 387 | } |
381 | 388 | ||
382 | /* Can deadlock when called with interrupts disabled */ | ||
383 | WARN_ON(irqs_disabled()); | ||
384 | |||
385 | spin_lock_bh(&call_lock); | 389 | spin_lock_bh(&call_lock); |
386 | __smp_call_function_single(cpu, func, info, nonatomic, wait); | 390 | __smp_call_function_single(cpu, func, info, nonatomic, wait); |
387 | spin_unlock_bh(&call_lock); | 391 | spin_unlock_bh(&call_lock); |