Unverified Commit 350f48e4 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12011 rtmutex: Drop rt_mutex::wait_lock before scheduling

parents 313516d1 784fcfe9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1220,6 +1220,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)
{
	/*
@@ -1229,6 +1230,7 @@ static void rt_mutex_handle_deadlock(int res, int detect_deadlock,
	if (res != -EDEADLOCK || detect_deadlock)
		return;

	raw_spin_unlock_irq(&lock->wait_lock);
	/*
	 * Yell lowdly and stop the task right here.
	 */
@@ -1284,7 +1286,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state,
	if (unlikely(ret)) {
		__set_current_state(TASK_RUNNING);
		remove_waiter(lock, &waiter);
		rt_mutex_handle_deadlock(ret, chwalk, &waiter);
		rt_mutex_handle_deadlock(ret, chwalk, lock, &waiter);
	}

	/*