diff options
Diffstat (limited to 'debian/patches-rt/0008-serial-core-Provide-low-level-functions-to-lock-port.patch')
-rw-r--r-- | debian/patches-rt/0008-serial-core-Provide-low-level-functions-to-lock-port.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/debian/patches-rt/0008-serial-core-Provide-low-level-functions-to-lock-port.patch b/debian/patches-rt/0008-serial-core-Provide-low-level-functions-to-lock-port.patch new file mode 100644 index 0000000000..75761ae021 --- /dev/null +++ b/debian/patches-rt/0008-serial-core-Provide-low-level-functions-to-lock-port.patch @@ -0,0 +1,50 @@ +From: John Ogness <john.ogness@linutronix.de> +Date: Mon, 11 Dec 2023 09:19:18 +0000 +Subject: [PATCH 08/46] serial: core: Provide low-level functions to lock port +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/6.9/older/patches-6.9-rt5.tar.xz + +It will be necessary at times for the uart nbcon console +drivers to acquire the port lock directly (without the +additional nbcon functionality of the port lock wrappers). +These are special cases such as the implementation of the +device_lock()/device_unlock() callbacks or for internal +port lock wrapper synchronization. + +Provide low-level variants __uart_port_lock_irqsave() and +__uart_port_unlock_irqrestore() for this purpose. + +Signed-off-by: John Ogness <john.ogness@linutronix.de> +Reviewed-by: Petr Mladek <pmladek@suse.com> +Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +--- + include/linux/serial_core.h | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +--- a/include/linux/serial_core.h ++++ b/include/linux/serial_core.h +@@ -591,6 +591,24 @@ struct uart_port { + void *private_data; /* generic platform data pointer */ + }; + ++/* ++ * Only for console->device_lock()/_unlock() callbacks and internal ++ * port lock wrapper synchronization. ++ */ ++static inline void __uart_port_lock_irqsave(struct uart_port *up, unsigned long *flags) ++{ ++ spin_lock_irqsave(&up->lock, *flags); ++} ++ ++/* ++ * Only for console->device_lock()/_unlock() callbacks and internal ++ * port lock wrapper synchronization. ++ */ ++static inline void __uart_port_unlock_irqrestore(struct uart_port *up, unsigned long flags) ++{ ++ spin_unlock_irqrestore(&up->lock, flags); ++} ++ + /** + * uart_port_lock - Lock the UART port + * @up: Pointer to UART port structure |