Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1642273 > unrolled thread

[PATCH] serial: meson: add Magic SysRq support

Started byYixun Lan <dlan@gentoo.org>
First post2017-05-16 09:50 +0200
Last post2017-05-16 10:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] serial: meson: add Magic SysRq support Yixun Lan <dlan@gentoo.org> - 2017-05-16 09:50 +0200
    Re: [PATCH] serial: meson: add Magic SysRq support Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-05-16 10:10 +0200

#1642273 — [PATCH] serial: meson: add Magic SysRq support

FromYixun Lan <dlan@gentoo.org>
Date2017-05-16 09:50 +0200
Subject[PATCH] serial: meson: add Magic SysRq support
Message-ID<tHFoZ-2Ho-5@gated-at.bofh.it>
Signed-off-by: Yixun Lan <dlan@gentoo.org>
---
 drivers/tty/serial/meson_uart.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index 60f16795d16b..f0d9222db82f 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -14,6 +14,10 @@
  *
  */
 
+#if defined(CONFIG_SERIAL_MESON_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+#define SUPPORT_SYSRQ
+#endif
+
 #include <linux/clk.h>
 #include <linux/console.h>
 #include <linux/delay.h>
@@ -183,12 +187,12 @@ static void meson_receive_chars(struct uart_port *port)
 {
 	struct tty_port *tport = &port->state->port;
 	char flag;
-	u32 status, ch, mode;
+	u32 ostatus, status, ch, mode;
 
 	do {
 		flag = TTY_NORMAL;
 		port->icount.rx++;
-		status = readl(port->membase + AML_UART_STATUS);
+		ostatus = status = readl(port->membase + AML_UART_STATUS);
 
 		if (status & AML_UART_ERR) {
 			if (status & AML_UART_TX_FIFO_WERR)
@@ -216,6 +220,16 @@ static void meson_receive_chars(struct uart_port *port)
 		ch = readl(port->membase + AML_UART_RFIFO);
 		ch &= 0xff;
 
+		if ((ostatus & AML_UART_FRAME_ERR) && (ch == 0)) {
+			port->icount.brk++;
+			flag = TTY_BREAK;
+			if (uart_handle_break(port))
+				continue;
+		}
+
+		if (uart_handle_sysrq_char(port, ch))
+			continue;
+
 		if ((status & port->ignore_status_mask) == 0)
 			tty_insert_flip_char(tport, ch, flag);
 
-- 
2.12.2

[toc] | [next] | [standalone]


#1642289

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-05-16 10:10 +0200
Message-ID<tHFIm-36E-13@gated-at.bofh.it>
In reply to#1642273
On Tue, May 16, 2017 at 03:45:29PM +0800, Yixun Lan wrote:
> Signed-off-by: Yixun Lan <dlan@gentoo.org>

I don't accept patches without any changelog text, sorry.

Please fix.

thanks,

greg k-h

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web