lkml.org 
[lkml]   [2013]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] up.c: Use local_irq_{save,restore}() in smp_call_function_single.
Date
From: David Daney <david.daney@cavium.com>

The SMP version of this function doesn't unconditionally enable irqs,
so neither should this !SMP version. There are no know problems
caused by this, but we make the change for consistency's sake.

Signed-off-by: David Daney <david.daney@cavium.com>
---
kernel/up.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/up.c b/kernel/up.c
index 144e572..b1cf036 100644
--- a/kernel/up.c
+++ b/kernel/up.c
@@ -10,11 +10,13 @@
int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
int wait)
{
+ unsigned long flags;
+
WARN_ON(cpu != 0);

- local_irq_disable();
- (func)(info);
- local_irq_enable();
+ local_irq_save(flags);
+ func(info);
+ local_irq_restore(flags);

return 0;
}
--
1.7.11.7


\
 
 \ /
  Last update: 2013-08-02 23:21    [W:0.050 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site