aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2007-03-05 17:35:41 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-03-05 17:35:41 -0500
commit25864162c15e61b494aa619974a4d521270362f7 (patch)
tree682889a684707f05d020363ee54b29022d370c17 /arch/s390
parentf794c8279d02ccd69429d816eb03fa12c130d06d (diff)
[S390] smp: disable preemption in smp_call_function/smp_call_function_on
Avoid sprinkling a _lot_ of preempt_disable/preempt_enable pairs. This would be necessary for e.g. the iucv driver. Also this way we are more consistent with other architectures which disable preemption at least for smp_call_function. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/smp.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index ecaa432a99f8..97764f710bb7 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -94,10 +94,9 @@ static void __smp_call_function_map(void (*func) (void *info), void *info,
94 int cpu, local = 0; 94 int cpu, local = 0;
95 95
96 /* 96 /*
97 * Can deadlock when interrupts are disabled or if in wrong context, 97 * Can deadlock when interrupts are disabled or if in wrong context.
98 * caller must disable preemption
99 */ 98 */
100 WARN_ON(irqs_disabled() || in_irq() || preemptible()); 99 WARN_ON(irqs_disabled() || in_irq());
101 100
102 /* 101 /*
103 * Check for local function call. We have to have the same call order 102 * Check for local function call. We have to have the same call order
@@ -152,17 +151,18 @@ out:
152 * Run a function on all other CPUs. 151 * Run a function on all other CPUs.
153 * 152 *
154 * You must not call this function with disabled interrupts or from a 153 * You must not call this function with disabled interrupts or from a
155 * hardware interrupt handler. Must be called with preemption disabled. 154 * hardware interrupt handler. You may call it from a bottom half.
156 * You may call it from a bottom half.
157 */ 155 */
158int smp_call_function(void (*func) (void *info), void *info, int nonatomic, 156int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
159 int wait) 157 int wait)
160{ 158{
161 cpumask_t map; 159 cpumask_t map;
162 160
161 preempt_disable();
163 map = cpu_online_map; 162 map = cpu_online_map;
164 cpu_clear(smp_processor_id(), map); 163 cpu_clear(smp_processor_id(), map);
165 __smp_call_function_map(func, info, nonatomic, wait, map); 164 __smp_call_function_map(func, info, nonatomic, wait, map);
165 preempt_enable();
166 return 0; 166 return 0;
167} 167}
168EXPORT_SYMBOL(smp_call_function); 168EXPORT_SYMBOL(smp_call_function);
@@ -178,16 +178,17 @@ EXPORT_SYMBOL(smp_call_function);
178 * Run a function on one processor. 178 * Run a function on one processor.
179 * 179 *
180 * You must not call this function with disabled interrupts or from a 180 * You must not call this function with disabled interrupts or from a
181 * hardware interrupt handler. Must be called with preemption disabled. 181 * hardware interrupt handler. You may call it from a bottom half.
182 * You may call it from a bottom half.
183 */ 182 */
184int smp_call_function_on(void (*func) (void *info), void *info, int nonatomic, 183int smp_call_function_on(void (*func) (void *info), void *info, int nonatomic,
185 int wait, int cpu) 184 int wait, int cpu)
186{ 185{
187 cpumask_t map = CPU_MASK_NONE; 186 cpumask_t map = CPU_MASK_NONE;
188 187
188 preempt_disable();
189 cpu_set(cpu, map); 189 cpu_set(cpu, map);
190 __smp_call_function_map(func, info, nonatomic, wait, map); 190 __smp_call_function_map(func, info, nonatomic, wait, map);
191 preempt_enable();
191 return 0; 192 return 0;
192} 193}
193EXPORT_SYMBOL(smp_call_function_on); 194EXPORT_SYMBOL(smp_call_function_on);