summaryrefslogtreecommitdiffstats
path: root/include/linux/rtmutex.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-08-15 23:27:38 +0200
committerIngo Molnar <mingo@kernel.org>2021-08-17 16:38:50 +0200
commitb41cda03765580caf7723b8c1b672d191c71013f (patch)
treebd12bf4d2037da6a4d36d05e8e30e4ff93441c65 /include/linux/rtmutex.h
parentd8bbd97ad0b99a9394f2cd8410b884c48e218cf0 (diff)
downloadlinux-b41cda03765580caf7723b8c1b672d191c71013f.tar.gz
linux-b41cda03765580caf7723b8c1b672d191c71013f.tar.bz2
linux-b41cda03765580caf7723b8c1b672d191c71013f.zip
locking/rtmutex: Set proper wait context for lockdep
RT mutexes belong to the LD_WAIT_SLEEP class. Make them so. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20210815211302.031014562@linutronix.de
Diffstat (limited to 'include/linux/rtmutex.h')
-rw-r--r--include/linux/rtmutex.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h
index d1672de9ca89..87b325aec508 100644
--- a/include/linux/rtmutex.h
+++ b/include/linux/rtmutex.h
@@ -52,17 +52,22 @@ do { \
} while (0)
#ifdef CONFIG_DEBUG_LOCK_ALLOC
-#define __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname) \
- , .dep_map = { .name = #mutexname }
+#define __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname) \
+ .dep_map = { \
+ .name = #mutexname, \
+ .wait_type_inner = LD_WAIT_SLEEP, \
+ }
#else
#define __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname)
#endif
-#define __RT_MUTEX_INITIALIZER(mutexname) \
- { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \
- , .waiters = RB_ROOT_CACHED \
- , .owner = NULL \
- __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname)}
+#define __RT_MUTEX_INITIALIZER(mutexname) \
+{ \
+ .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock), \
+ .waiters = RB_ROOT_CACHED, \
+ .owner = NULL, \
+ __DEP_MAP_RT_MUTEX_INITIALIZER(mutexname) \
+}
#define DEFINE_RT_MUTEX(mutexname) \
struct rt_mutex mutexname = __RT_MUTEX_INITIALIZER(mutexname)