public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 7/8] lock validator: s390 use raw_spinlock in mcck handler
@ 2006-06-14 14:23 Heiko Carstens
  2006-06-14 18:25 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Carstens @ 2006-06-14 14:23 UTC (permalink / raw)
  To: Ingo Molnar, Arjan van de Ven, Andrew Morton
  Cc: linux-kernel, Martin Schwidefsky

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

Machine checks on s390 are always enabled (except in the machine check handler
itself). Therefore use a raw_spinlock in the machine check handler to avoid
deadlocks in the lock validator.

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

 drivers/s390/s390mach.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -purN a/drivers/s390/s390mach.c b/drivers/s390/s390mach.c
--- a/drivers/s390/s390mach.c	2006-06-14 13:44:52.000000000 +0200
+++ b/drivers/s390/s390mach.c	2006-06-14 13:45:01.000000000 +0200
@@ -372,7 +372,7 @@ s390_revalidate_registers(struct mci *mc
 void
 s390_do_machine_check(struct pt_regs *regs)
 {
-	static DEFINE_SPINLOCK(ipd_lock);
+	static raw_spinlock_t ipd_lock = (raw_spinlock_t)__RAW_SPIN_LOCK_UNLOCKED;
 	static unsigned long long last_ipd;
 	static int ipd_count;
 	unsigned long long tmp;
@@ -418,7 +418,7 @@ s390_do_machine_check(struct pt_regs *re
 			 * retry this instruction.
 			 */
 
-			spin_lock(&ipd_lock);
+			__raw_spin_lock(&ipd_lock);
 
 			tmp = get_clock();
 
@@ -432,7 +432,7 @@ s390_do_machine_check(struct pt_regs *re
 			if (ipd_count == MAX_IPD_COUNT)
 				s390_handle_damage("too many ipd retries.");
 
-			spin_unlock(&ipd_lock);
+			__raw_spin_unlock(&ipd_lock);
 		}
 		else {
 			/* Processing damage -> stopping machine */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 7/8] lock validator: s390 use raw_spinlock in mcck handler
  2006-06-14 14:23 [patch 7/8] lock validator: s390 use raw_spinlock in mcck handler Heiko Carstens
@ 2006-06-14 18:25 ` Ingo Molnar
  2006-06-14 18:47   ` Heiko Carstens
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Molnar @ 2006-06-14 18:25 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Arjan van de Ven, Andrew Morton, linux-kernel, Martin Schwidefsky


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

> From: Heiko Carstens <heiko.carstens@de.ibm.com>
> 
> Machine checks on s390 are always enabled (except in the machine check 
> handler itself). Therefore use a raw_spinlock in the machine check 
> handler to avoid deadlocks in the lock validator.

hm, couldnt you use the ->lockdep_recursion mechanism to take care of 
such cases? Just call lockdep_off() when entering a machine exception 
handler, and lockdep_on() when exiting it.

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 7/8] lock validator: s390 use raw_spinlock in mcck handler
  2006-06-14 18:25 ` Ingo Molnar
@ 2006-06-14 18:47   ` Heiko Carstens
  0 siblings, 0 replies; 3+ messages in thread
From: Heiko Carstens @ 2006-06-14 18:47 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Arjan van de Ven, Andrew Morton, linux-kernel, Martin Schwidefsky

On Wed, Jun 14, 2006 at 09:25:16PM +0200, Ingo Molnar wrote:
> 
> * Heiko Carstens <heiko.carstens@de.ibm.com> wrote:
> 
> > From: Heiko Carstens <heiko.carstens@de.ibm.com>
> > 
> > Machine checks on s390 are always enabled (except in the machine check 
> > handler itself). Therefore use a raw_spinlock in the machine check 
> > handler to avoid deadlocks in the lock validator.
> 
> hm, couldnt you use the ->lockdep_recursion mechanism to take care of 
> such cases? Just call lockdep_off() when entering a machine exception 
> handler, and lockdep_on() when exiting it.

Ah, sure. Wasn't aware that there is such an interface. Will do.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-06-14 18:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-14 14:23 [patch 7/8] lock validator: s390 use raw_spinlock in mcck handler Heiko Carstens
2006-06-14 18:25 ` Ingo Molnar
2006-06-14 18:47   ` Heiko Carstens

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