@@ -1591,6 +1591,7 @@ __rt_mutex_slowlock(struct rt_mutex *lock, int state,
}
static void rt_mutex_handle_deadlock(int res, int detect_deadlock,
+ struct rt_mutex *lock,
struct rt_mutex_waiter *w)
{
/*
@@ -1600,6 +1601,8 @@ static void rt_mutex_handle_deadlock(int res, int detect_deadlock,
if (res != -EDEADLOCK || detect_deadlock)
return;
+ raw_spin_unlock_irq(&lock->wait_lock);
+
while (1) {
set_current_state(TASK_INTERRUPTIBLE);
schedule();
@@ -1730,7 +1733,7 @@ int __sched rt_mutex_slowlock_locked(struct rt_mutex *lock, int state,
remove_waiter(lock, waiter);
/* ww_mutex wants to report EDEADLK/EALREADY, let it */
if (!ww_ctx)
- rt_mutex_handle_deadlock(ret, chwalk, waiter);
+ rt_mutex_handle_deadlock(ret, chwalk, lock, waiter);
} else if (ww_ctx) {
ww_mutex_account_lock(lock, ww_ctx);
}