Skip to content

Commit

Permalink
smp: quit unconditionally enabling irqs in on_each_cpu_mask().
Browse files Browse the repository at this point in the history
As in commit f21afc2 ('smp.h: Use local_irq_{save,restore}() in
are not already enabled.

I don't know of any bugs currently caused by this unconditional
local_irq_enable(), but I want to use this function in MIPS/OCTEON early
boot (when we have early_boot_irqs_disabled).  This also makes this
function have similar semantics to on_each_cpu() which is good in
itself.

Signed-off-by: David Daney <david.daney@cavium.com>
Cc: Gilad Ben-Yossef <gilad@benyossef.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
daviddaney authored and javilonas committed Jun 9, 2015
1 parent 037bcbc commit aa7b7ea
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions kernel/smp.c
Expand Up @@ -589,8 +589,10 @@ EXPORT_SYMBOL(on_each_cpu);
*
* If @wait is true, then returns once @func has returned.
*
* You must not call this function with disabled interrupts or
* from a hardware interrupt handler or from a bottom half handler.
* You must not call this function with disabled interrupts or from a
* hardware interrupt handler or from a bottom half handler. The
* exception is that it may be used during early boot while
* early_boot_irqs_disabled is set.
*/
void on_each_cpu_mask(const struct cpumask *mask, smp_call_func_t func,
void *info, bool wait)
Expand All @@ -599,9 +601,10 @@ void on_each_cpu_mask(const struct cpumask *mask, smp_call_func_t func,

smp_call_function_many(mask, func, info, wait);
if (cpumask_test_cpu(cpu, mask)) {
local_irq_disable();
unsigned long flags;
local_irq_save(flags);
func(info);
local_irq_enable();
local_irq_restore(flags);
}
put_cpu();
}
Expand Down

0 comments on commit aa7b7ea

Please sign in to comment.