@@ -88,6 +88,7 @@ extern void __rt_mutex_init(struct rt_mutex *lock, const char *name);
extern void rt_mutex_destroy(struct rt_mutex *lock);
extern void rt_mutex_lock(struct rt_mutex *lock);
+extern void rt_mutex_lock_irqdisabled(struct rt_mutex *lock);
extern int rt_mutex_lock_interruptible(struct rt_mutex *lock,
int detect_deadlock);
extern int rt_mutex_timed_lock(struct rt_mutex *lock,
@@ -797,6 +797,19 @@ void __sched rt_mutex_lock(struct rt_mutex *lock)
EXPORT_SYMBOL_GPL(rt_mutex_lock);
/**
+ * rt_mutex_lock_irqdisabled - lock a rt_mutex with irq disabled
+ *
+ * @lock: the rt_mutex to be locked
+ */
+void __sched rt_mutex_lock_irqdisabled(struct rt_mutex *lock)
+{
+ might_sleep_irqdisabled();
+
+ rt_mutex_fastlock(lock, TASK_UNINTERRUPTIBLE, 0, rt_mutex_slowlock);
+}
+EXPORT_SYMBOL_GPL(rt_mutex_lock_irqdisabled);
+
+/**
* rt_mutex_lock_interruptible - lock a rt_mutex interruptible
*
* @lock: the rt_mutex to be locked
Since we permit rt_mutex_lock() to be called with irq disabled in commit 5342e269, and we will call might_sleep() in rt_mutex_lock() unconditionally, false positive will be made. So introduce rt_mutex_lock_irqdisabled() for that kind of usage. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> --- include/linux/rtmutex.h | 1 + kernel/rtmutex.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 0 deletions(-)