提交 babeca85 编写于 作者: D Douglas Anderson 提交者: Greg Kroah-Hartman

serial: qcom_geni_serial: Finish supporting sysrq

The geni serial driver already had some sysrq code in it, but since
SUPPORT_SYSRQ wasn't defined the code didn't do anything useful.
Let's make it useful by adding that define using the same formula
found in other serial drivers.

In order to prevent deadlock, we'll take a page from the
'msm_serial.c' where the spinlock is released around
uart_handle_sysrq_char().  This seemed better than copying from
'8250_port.c' where we skip locking in the console_write function
since the '8250_port.c' method can cause lockdep warnings when
dropping into kgdb.
Signed-off-by: NDouglas Anderson <dianders@chromium.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6d11023c
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2017-2018, The Linux foundation. All rights reserved. // Copyright (c) 2017-2018, The Linux foundation. All rights reserved.
#if defined(CONFIG_SERIAL_QCOM_GENI_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
# define SUPPORT_SYSRQ
#endif
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/io.h> #include <linux/io.h>
...@@ -493,7 +497,10 @@ static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) ...@@ -493,7 +497,10 @@ static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop)
continue; continue;
} }
spin_unlock(&uport->lock);
sysrq = uart_handle_sysrq_char(uport, buf[c]); sysrq = uart_handle_sysrq_char(uport, buf[c]);
spin_lock(&uport->lock);
if (!sysrq) if (!sysrq)
tty_insert_flip_char(tport, buf[c], TTY_NORMAL); tty_insert_flip_char(tport, buf[c], TTY_NORMAL);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册