summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0130-serial-core-Provide-low-level-functions-to-port-lock.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:28:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-11 08:28:00 +0000
commit3565071f226432336a54d0193d729fa4508a3394 (patch)
tree4cde13f078f84c0a7785d234fd52edce7c90546a /debian/patches-rt/0130-serial-core-Provide-low-level-functions-to-port-lock.patch
parentAdding upstream version 6.6.15. (diff)
downloadlinux-3565071f226432336a54d0193d729fa4508a3394.tar.xz
linux-3565071f226432336a54d0193d729fa4508a3394.zip
Adding debian version 6.6.15-2.debian/6.6.15-2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches-rt/0130-serial-core-Provide-low-level-functions-to-port-lock.patch')
-rw-r--r--debian/patches-rt/0130-serial-core-Provide-low-level-functions-to-port-lock.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/debian/patches-rt/0130-serial-core-Provide-low-level-functions-to-port-lock.patch b/debian/patches-rt/0130-serial-core-Provide-low-level-functions-to-port-lock.patch
new file mode 100644
index 000000000..e8e506fe5
--- /dev/null
+++ b/debian/patches-rt/0130-serial-core-Provide-low-level-functions-to-port-lock.patch
@@ -0,0 +1,43 @@
+From: John Ogness <john.ogness@linutronix.de>
+Date: Mon, 11 Dec 2023 09:19:18 +0000
+Subject: [PATCH 130/134] serial: core: Provide low-level functions to port
+ lock
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/6.6/older/patches-6.6.7-rt18.tar.xz
+
+The nbcon console's driver_enter() and driver_exit() callbacks need
+to lock the port lock in order to synchronize against other hardware
+activity (such as adjusting baud rates). However, they cannot use
+the uart_port_lock() wrappers because the printk subsystem will
+perform nbcon locking after calling the driver_enter() callback.
+
+Provide low-level variants __uart_port_lock_irqsave() and
+__uart_port_unlock_irqrestore() for this purpose. These are only
+to be used by the driver_enter()/driver_exit() callbacks.
+
+Signed-off-by: John Ogness <john.ogness@linutronix.de>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+---
+ include/linux/serial_core.h | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+--- a/include/linux/serial_core.h
++++ b/include/linux/serial_core.h
+@@ -681,6 +681,18 @@ static inline void uart_port_unlock_irqr
+ spin_unlock_irqrestore(&up->lock, flags);
+ }
+
++/* Only for use in the console->driver_enter() callback. */
++static inline void __uart_port_lock_irqsave(struct uart_port *up, unsigned long *flags)
++{
++ spin_lock_irqsave(&up->lock, *flags);
++}
++
++/* Only for use in the console->driver_exit() callback. */
++static inline void __uart_port_unlock_irqrestore(struct uart_port *up, unsigned long flags)
++{
++ spin_unlock_irqrestore(&up->lock, flags);
++}
++
+ static inline int serial_port_in(struct uart_port *up, int offset)
+ {
+ return up->serial_in(up, offset);