Skip to contentSkip to conversation

Add/extend WARN_ONs in smp_call_function & smp_call_function_on.

S390 Martin Schwidefsky 1 participant 1 message Feb 6, 2007 s390

lore
Share & tools
lore
#0 lore raw

From: Heiko Carstens <[email protected]>

[S390] Add/extend WARN_ONs in smp_call_function & smp_call_function_on.

Let smp_call_function & smp_call_function_on complain if called with interrupts disabled or called from a wrong context.

---

 arch/s390/kernel/smp.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
arch/s390/kernel/smp.c +6 -3
diff -urpN linux-2.6/arch/s390/kernel/smp.c linux-2.6-patched/arch/s390/kernel/smp.c
@@ -57,7 +57,7 @@ static void smp_ext_bitcall(int, ec_bit_
 static void smp_ext_bitcall_others(ec_bit_sig);
 
 /*
-5B * Structure and data for smp_call_function(). This is designed to minimise
+ * Structure and data for smp_call_function(). This is designed to minimise
  * static memory requirements. It also looks cleaner.
  */
 static DEFINE_SPINLOCK(call_lock);
@@ -113,8 +113,8 @@ int smp_call_function (void (*func) (voi
 	if (cpus <= 0)
 		return 0;
 
-	/* Can deadlock when called with interrupts disabled */
-	WARN_ON(irqs_disabled());
+	/* Can deadlock when interrupts are disabled or if in wrong context */
+	WARN_ON(irqs_disabled() || in_interrupt());
 
 	data.func = func;
 	data.info = info;
@@ -159,6 +159,9 @@ int smp_call_function_on(void (*func) (v
 	if (!cpu_online(cpu))
 		return -EINVAL;
 
+	/* Can deadlock when interrupts are disabled or if in wrong context */
+	WARN_ON(irqs_disabled() || in_irq());
+
 	/* disable preemption for local function call */
 	curr_cpu = get_cpu();