summaryrefslogtreecommitdiff
path: root/include/linux/serial_core.h
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2021-04-16 16:05:55 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-22 12:04:26 +0200
commit75f4e830fa9c47637054a3b7201765f2a314bda2 (patch)
treeeee2f6223ed380cc8ed106f4342213c2ebef469e /include/linux/serial_core.h
parent86eb032675766e633ba1ad2902776533e8dd576b (diff)
serial: do not restore interrupt state in sysrq helper
The uart_unlock_and_check_sysrq() helper can be used to defer processing of sysrq until the interrupt handler has released the port lock and is about to return. Since commit 81e2073c175b ("genirq: Disable interrupts for force threaded handlers") interrupt handlers that are not explicitly requested as threaded are always called with interrupts disabled and there is no need to save the interrupt state when taking the port lock. Instead of adding another sysrq helper for when the interrupt state has not needlessly been saved, drop the state parameter from uart_unlock_and_check_sysrq() and update its callers to no longer explicitly disable interrupts in their interrupt handlers. Cc: Joel Stanley <joel@jms.id.au> Cc: Andrew Jeffery <andrew@aj.id.au> Cc: Andy Gross <agross@kernel.org> Cc: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20210416140557.25177-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/serial_core.h')
-rw-r--r--include/linux/serial_core.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index e1b684e33841..d7ed00f1594e 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -500,19 +500,19 @@ static inline int uart_prepare_sysrq_char(struct uart_port *port, unsigned int c
return 0;
}
-static inline void uart_unlock_and_check_sysrq(struct uart_port *port, unsigned long irqflags)
+static inline void uart_unlock_and_check_sysrq(struct uart_port *port)
{
int sysrq_ch;
if (!port->has_sysrq) {
- spin_unlock_irqrestore(&port->lock, irqflags);
+ spin_unlock(&port->lock);
return;
}
sysrq_ch = port->sysrq_ch;
port->sysrq_ch = 0;
- spin_unlock_irqrestore(&port->lock, irqflags);
+ spin_unlock(&port->lock);
if (sysrq_ch)
handle_sysrq(sysrq_ch);
@@ -526,9 +526,9 @@ static inline int uart_prepare_sysrq_char(struct uart_port *port, unsigned int c
{
return 0;
}
-static inline void uart_unlock_and_check_sysrq(struct uart_port *port, unsigned long irqflags)
+static inline void uart_unlock_and_check_sysrq(struct uart_port *port)
{
- spin_unlock_irqrestore(&port->lock, irqflags);
+ spin_unlock(&port->lock);
}
#endif /* CONFIG_MAGIC_SYSRQ_SERIAL */