Skip to contentSkip to conversation

PATCH Darren Hart 1 participant 1 message Jul 27, 2011

lore
Share & tools
lore
#0 lore raw

Without the raw_spin_lock_init(), the wait_lock does not get properly initialized with CONFIG_DEBUG_SPINLOCK. This can manifest in a BUG() in the futex requeue_pi path when the pi_state->pi_mutex->wait_lock fails the magic test in rt_mutex_start_proxy_lock()->raw_spin_lock(&lock->wait_lock).

CC Maarten Lankhorst <[email protected]>
CC Thomas Gleixner <[email protected]>
CC Steven Rostedt <[email protected]>
---
 rtmutex.c |    1 +
 1 file changed, 1 insertion(+)
kernel/rtmutex.c +1 -0
Index: linux-3.0-rt/kernel/rtmutex.c
===================================================================
@@ -1277,6 +1277,7 @@ EXPORT_SYMBOL_GPL(rt_mutex_destroy);
 void __rt_mutex_init(struct rt_mutex *lock, const char *name)
 {
 	lock->owner = NULL;
+	raw_spin_lock_init(&lock->wait_lock);
 	plist_head_init_raw(&lock->wait_list, &lock->wait_lock);
 
 	debug_rt_mutex_init(lock, name);