public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [S390] sclp: don't call local_bh_disable/_local_bh_enable if in_interrupt()
@ 2007-01-26 16:50 Martin Schwidefsky
  0 siblings, 0 replies; only message in thread
From: Martin Schwidefsky @ 2007-01-26 16:50 UTC (permalink / raw)
  To: linux-kernel, linux-s390; +Cc: heiko.carstens

From: Heiko Carstens <heiko.carstens@de.ibm.com>

[S390] sclp: don't call local_bh_disable/_local_bh_enable if in_interrupt()

local_bh_disable/_local_bh_enable must not be called if in_irq() is
true. Besides that if in_interrupt() is true bottom halves are
disabled anyway.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 drivers/s390/char/sclp.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff -urpN linux-2.6/drivers/s390/char/sclp.c linux-2.6-patched/drivers/s390/char/sclp.c
--- linux-2.6/drivers/s390/char/sclp.c	2007-01-26 17:27:54.000000000 +0100
+++ linux-2.6-patched/drivers/s390/char/sclp.c	2007-01-26 17:27:58.000000000 +0100
@@ -402,6 +402,7 @@ sclp_sync_wait(void)
 	unsigned long flags;
 	unsigned long cr0, cr0_sync;
 	u64 timeout;
+	int irq_context;
 
 	/* We'll be disabling timer interrupts, so we need a custom timeout
 	 * mechanism */
@@ -414,7 +415,9 @@ sclp_sync_wait(void)
 	}
 	local_irq_save(flags);
 	/* Prevent bottom half from executing once we force interrupts open */
-	local_bh_disable();
+	irq_context = in_interrupt();
+	if (!irq_context)
+		local_bh_disable();
 	/* Enable service-signal interruption, disable timer interrupts */
 	trace_hardirqs_on();
 	__ctl_store(cr0, 0, 0);
@@ -435,7 +438,8 @@ sclp_sync_wait(void)
 	}
 	local_irq_disable();
 	__ctl_load(cr0, 0, 0);
-	_local_bh_enable();
+	if (!irq_context)
+		_local_bh_enable();
 	local_irq_restore(flags);
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-01-26 16:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-26 16:50 [S390] sclp: don't call local_bh_disable/_local_bh_enable if in_interrupt() Martin Schwidefsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox