summaryrefslogtreecommitdiff
path: root/include/linux/serial_core.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-06-01 18:08:02 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-06-01 18:08:02 +0200
commitb586d69177b5fc92450a5f37a3bb1ce50aa87e39 (patch)
tree4bde635f30956784cbf70e52fafaeb86ad846284 /include/linux/serial_core.h
parent255dc0ec0b79c354bff017f6d6202adaa092a1c9 (diff)
parente43ffb69e0438cddd72aaa30898b4dc446f664f8 (diff)
downloadlwn-b586d69177b5fc92450a5f37a3bb1ce50aa87e39.tar.gz
lwn-b586d69177b5fc92450a5f37a3bb1ce50aa87e39.zip
Merge tag 'v7.1-rc6' into tty-next
We need the tty/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/serial_core.h')
-rw-r--r--include/linux/serial_core.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 17fcff466e30..bdc214386e4a 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -1295,6 +1295,18 @@ static inline void uart_unlock_and_check_sysrq_irqrestore(struct uart_port *port
#endif /* CONFIG_MAGIC_SYSRQ_SERIAL */
/*
+ * Variant of guard(uart_port_lock_irqsave) for IRQ handlers that may capture
+ * a SysRq character via uart_prepare_sysrq_char(). The destructor uses the
+ * sysrq-aware unlock helper so that a captured port->sysrq_ch is dispatched
+ * to handle_sysrq() on scope exit. The plain guard variant silently drops
+ * sysrq_ch and must not be used by callers that process RX.
+ */
+DEFINE_LOCK_GUARD_1(uart_port_lock_check_sysrq_irqsave, struct uart_port,
+ uart_port_lock_irqsave(_T->lock, &_T->flags),
+ uart_unlock_and_check_sysrq_irqrestore(_T->lock, _T->flags),
+ unsigned long flags);
+
+/*
* We do the SysRQ and SAK checking like this...
*/
static inline int uart_handle_break(struct uart_port *port)