summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0127-rtmutex-trylock-is-okay-on-RT.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/0127-rtmutex-trylock-is-okay-on-RT.patch
parentAdding upstream version 4.19.249. (diff)
downloadlinux-08b74a000942a380fe028845f92cd3a0dee827d5.tar.xz
linux-08b74a000942a380fe028845f92cd3a0dee827d5.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/0127-rtmutex-trylock-is-okay-on-RT.patch')
-rw-r--r--debian/patches-rt/0127-rtmutex-trylock-is-okay-on-RT.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/debian/patches-rt/0127-rtmutex-trylock-is-okay-on-RT.patch b/debian/patches-rt/0127-rtmutex-trylock-is-okay-on-RT.patch
new file mode 100644
index 000000000..292becc02
--- /dev/null
+++ b/debian/patches-rt/0127-rtmutex-trylock-is-okay-on-RT.patch
@@ -0,0 +1,34 @@
+From 0b94209cb7e2a97538d5f7cf08c0d1433cc83b05 Mon Sep 17 00:00:00 2001
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Wed, 2 Dec 2015 11:34:07 +0100
+Subject: [PATCH 127/347] rtmutex: trylock is okay on -RT
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.246-rt110.tar.xz
+
+non-RT kernel could deadlock on rt_mutex_trylock() in softirq context. On
+-RT we don't run softirqs in IRQ context but in thread context so it is
+not a issue here.
+
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+---
+ kernel/locking/rtmutex.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
+index a5ec4f68527e..4bec24dfafc6 100644
+--- a/kernel/locking/rtmutex.c
++++ b/kernel/locking/rtmutex.c
+@@ -1583,7 +1583,11 @@ int __sched rt_mutex_trylock(struct rt_mutex *lock)
+ {
+ int ret;
+
++#ifdef CONFIG_PREEMPT_RT_FULL
++ if (WARN_ON_ONCE(in_irq() || in_nmi()))
++#else
+ if (WARN_ON_ONCE(in_irq() || in_nmi() || in_serving_softirq()))
++#endif
+ return 0;
+
+ ret = rt_mutex_fasttrylock(lock, rt_mutex_slowtrylock);
+--
+2.36.1
+