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 81e2073c17 ("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
86eb032675
commit
75f4e830fa
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user