Skip to contentSkip to conversation

lock validator: s390 use raw_spinlock in mcck handler

PATCH In review Heiko Carstens 2 participants 3 messages Jun 14, 2006 s390

lore
Share & tools
lore
#0 lore raw

PATCH 7/8 lock validator: s390 use raw_spinlock in mcck handler

From: Heiko Carstens <[email protected]>

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.

---

 drivers/s390/s390mach.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/s390/s390mach.c +3 -3
diff -purN a/drivers/s390/s390mach.c b/drivers/s390/s390mach.c
@@ -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 */
#1 lore raw
Quoted 5 lines · Heiko Carstens

From: Heiko Carstens <[email protected]>

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

#2 lore raw
Quoted 5 lines · Ingo Molnar
Quoted 2 lines · Heiko Carstens

From: Heiko Carstens <[email protected]>

Quoted 7 lines
Quoted 3 lines

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.