summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0135-rtmutex-Add-rtmutex_lock_killable.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:02:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:02:38 +0000
commit08b74a000942a380fe028845f92cd3a0dee827d5 (patch)
treeaa78b4e12607c3e1fcce8d5cc42df4330792f118 /debian/patches-rt/0135-rtmutex-Add-rtmutex_lock_killable.patch
parentAdding upstream version 4.19.249. (diff)
downloadlinux-debian/4.19.249-2.tar.xz
linux-debian/4.19.249-2.zip
Adding debian version 4.19.249-2.debian/4.19.249-2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches-rt/0135-rtmutex-Add-rtmutex_lock_killable.patch')
-rw-r--r--debian/patches-rt/0135-rtmutex-Add-rtmutex_lock_killable.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/debian/patches-rt/0135-rtmutex-Add-rtmutex_lock_killable.patch b/debian/patches-rt/0135-rtmutex-Add-rtmutex_lock_killable.patch
new file mode 100644
index 000000000..92652b7a1
--- /dev/null
+++ b/debian/patches-rt/0135-rtmutex-Add-rtmutex_lock_killable.patch
@@ -0,0 +1,60 @@
+From 12727f37858de62d47250dc9fcee2ce4ea19dd66 Mon Sep 17 00:00:00 2001
+From: Thomas Gleixner <tglx@linutronix.de>
+Date: Thu, 9 Jun 2011 11:43:52 +0200
+Subject: [PATCH 135/347] rtmutex: Add rtmutex_lock_killable()
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.246-rt110.tar.xz
+
+Add "killable" type to rtmutex. We need this since rtmutex are used as
+"normal" mutexes which do use this type.
+
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+---
+ include/linux/rtmutex.h | 1 +
+ kernel/locking/rtmutex.c | 19 +++++++++++++++++++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h
+index 6fd615a0eea9..81ece6a8291a 100644
+--- a/include/linux/rtmutex.h
++++ b/include/linux/rtmutex.h
+@@ -115,6 +115,7 @@ extern void rt_mutex_lock(struct rt_mutex *lock);
+ #endif
+
+ extern int rt_mutex_lock_interruptible(struct rt_mutex *lock);
++extern int rt_mutex_lock_killable(struct rt_mutex *lock);
+ extern int rt_mutex_timed_lock(struct rt_mutex *lock,
+ struct hrtimer_sleeper *timeout);
+
+diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
+index 069f025180b8..81bae2e3d82e 100644
+--- a/kernel/locking/rtmutex.c
++++ b/kernel/locking/rtmutex.c
+@@ -1562,6 +1562,25 @@ int __sched __rt_mutex_futex_trylock(struct rt_mutex *lock)
+ return __rt_mutex_slowtrylock(lock);
+ }
+
++/**
++ * rt_mutex_lock_killable - lock a rt_mutex killable
++ *
++ * @lock: the rt_mutex to be locked
++ * @detect_deadlock: deadlock detection on/off
++ *
++ * Returns:
++ * 0 on success
++ * -EINTR when interrupted by a signal
++ * -EDEADLK when the lock would deadlock (when deadlock detection is on)
++ */
++int __sched rt_mutex_lock_killable(struct rt_mutex *lock)
++{
++ might_sleep();
++
++ return rt_mutex_fastlock(lock, TASK_KILLABLE, rt_mutex_slowlock);
++}
++EXPORT_SYMBOL_GPL(rt_mutex_lock_killable);
++
+ /**
+ * rt_mutex_timed_lock - lock a rt_mutex interruptible
+ * the timeout structure is provided
+--
+2.36.1
+