43 lines
1.6 KiB
Diff
43 lines
1.6 KiB
Diff
From f74200caed950b05a273bf9907ad662c00f4994b Mon Sep 17 00:00:00 2001
|
|
Message-Id: <f74200caed950b05a273bf9907ad662c00f4994b.1590093525.git.zanussi@kernel.org>
|
|
In-Reply-To: <4f310e18bbb62e33196484e72d1a7d0416189d63.1590093525.git.zanussi@kernel.org>
|
|
References: <4f310e18bbb62e33196484e72d1a7d0416189d63.1590093525.git.zanussi@kernel.org>
|
|
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
Date: Thu, 16 Nov 2017 16:48:48 +0100
|
|
Subject: [PATCH 152/327] locking/rtmutex: re-init the wait_lock in
|
|
rt_mutex_init_proxy_locked()
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.124-rt53.tar.xz
|
|
|
|
We could provide a key-class for the lockdep (and fixup all callers) or
|
|
move the init to all callers (like it was) in order to avoid lockdep
|
|
seeing a double-lock of the wait_lock.
|
|
|
|
Reported-by: Fernando Lopez-Lezcano <nando@ccrma.Stanford.EDU>
|
|
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
---
|
|
kernel/locking/rtmutex.c | 8 ++++++++
|
|
1 file changed, 8 insertions(+)
|
|
|
|
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
|
|
index b38c3a92dce8..94788662b2f2 100644
|
|
--- a/kernel/locking/rtmutex.c
|
|
+++ b/kernel/locking/rtmutex.c
|
|
@@ -2281,6 +2281,14 @@ void rt_mutex_init_proxy_locked(struct rt_mutex *lock,
|
|
struct task_struct *proxy_owner)
|
|
{
|
|
__rt_mutex_init(lock, NULL, NULL);
|
|
+#ifdef CONFIG_DEBUG_SPINLOCK
|
|
+ /*
|
|
+ * get another key class for the wait_lock. LOCK_PI and UNLOCK_PI is
|
|
+ * holding the ->wait_lock of the proxy_lock while unlocking a sleeping
|
|
+ * lock.
|
|
+ */
|
|
+ raw_spin_lock_init(&lock->wait_lock);
|
|
+#endif
|
|
debug_rt_mutex_proxy_lock(lock, proxy_owner);
|
|
rt_mutex_set_owner(lock, proxy_owner);
|
|
}
|
|
--
|
|
2.17.1
|
|
|