summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0337-locking-rwsem_rt-Add-__down_read_interruptible.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/0337-locking-rwsem_rt-Add-__down_read_interruptible.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/0337-locking-rwsem_rt-Add-__down_read_interruptible.patch')
-rw-r--r--debian/patches-rt/0337-locking-rwsem_rt-Add-__down_read_interruptible.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/debian/patches-rt/0337-locking-rwsem_rt-Add-__down_read_interruptible.patch b/debian/patches-rt/0337-locking-rwsem_rt-Add-__down_read_interruptible.patch
new file mode 100644
index 000000000..32dbf855c
--- /dev/null
+++ b/debian/patches-rt/0337-locking-rwsem_rt-Add-__down_read_interruptible.patch
@@ -0,0 +1,54 @@
+From 22e1c0d3e27bd960ae3561172ca15089721253c6 Mon Sep 17 00:00:00 2001
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Tue, 19 Jan 2021 18:54:33 +0100
+Subject: [PATCH 337/347] locking/rwsem_rt: Add __down_read_interruptible()
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.246-rt110.tar.xz
+
+The stable backported a patch which adds __down_read_interruptible() for
+the generic rwsem implementation.
+
+Add RT's version __down_read_interruptible().
+
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+---
+ include/linux/rwsem_rt.h | 1 +
+ kernel/locking/rwsem-rt.c | 11 +++++++++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/include/linux/rwsem_rt.h b/include/linux/rwsem_rt.h
+index 2018ff77904a..3fb092b7bcc0 100644
+--- a/include/linux/rwsem_rt.h
++++ b/include/linux/rwsem_rt.h
+@@ -56,6 +56,7 @@ static inline int rwsem_is_contended(struct rw_semaphore *sem)
+ }
+
+ extern void __down_read(struct rw_semaphore *sem);
++extern int __down_read_interruptible(struct rw_semaphore *sem);
+ extern int __down_read_killable(struct rw_semaphore *sem);
+ extern int __down_read_trylock(struct rw_semaphore *sem);
+ extern void __down_write(struct rw_semaphore *sem);
+diff --git a/kernel/locking/rwsem-rt.c b/kernel/locking/rwsem-rt.c
+index f518495bd6cc..19ea20be3fd7 100644
+--- a/kernel/locking/rwsem-rt.c
++++ b/kernel/locking/rwsem-rt.c
+@@ -166,6 +166,17 @@ void __down_read(struct rw_semaphore *sem)
+ WARN_ON_ONCE(ret);
+ }
+
++int __down_read_interruptible(struct rw_semaphore *sem)
++{
++ int ret;
++
++ ret = __down_read_common(sem, TASK_INTERRUPTIBLE);
++ if (likely(!ret))
++ return ret;
++ WARN_ONCE(ret != -EINTR, "Unexpected state: %d\n", ret);
++ return -EINTR;
++}
++
+ int __down_read_killable(struct rw_semaphore *sem)
+ {
+ int ret;
+--
+2.36.1
+