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


Groups > linux.kernel > #1297583

[PATCH] tty/serial: Skip 'NULL' char after console break when sysrq enabled

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Vijay Kumar <vijay.ac.kumar@oracle.com>
Newsgroups linux.kernel
Subject [PATCH] tty/serial: Skip 'NULL' char after console break when sysrq enabled
Date Wed, 23 Dec 2015 20:00:01 +0100
Message-ID <qIWNH-4OT-1@gated-at.bofh.it> (permalink)
X-Original-To davem@davemloft.net, gregkh@linuxfoundation.org, sparclinux@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, karl.volz@oracle.com
X-Mailer git-send-email 1.7.1
X-Source-IP userv0021.oracle.com [156.151.31.71]
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 39
Organization linux.* mail to news gateway
X-Original-Cc vijay.ac.kumar@oracle.com
X-Original-Date Wed, 23 Dec 2015 10:55:33 -0800
X-Original-Message-ID <1450896933-192269-1-git-send-email-vijay.ac.kumar@oracle.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1297583

Show key headers only | View raw


When sysrq is triggered from console, serial driver for SUN hypervisor
console receives a console break and enables the sysrq. It expects a valid
sysrq char following with break. Meanwhile if driver receives 'NULL'
ASCII char then it disables sysrq and sysrq handler will never be invoked.

This fix skips calling uart sysrq handler when 'NULL' is received while
sysrq is enabled.

Signed-off-by: Vijay Kumar <vijay.ac.kumar@oracle.com>
Acked-by: Karl Volz <karl.volz@oracle.com>
---
 drivers/tty/serial/sunhv.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c
index 0640318..163ae5d 100644
--- a/drivers/tty/serial/sunhv.c
+++ b/drivers/tty/serial/sunhv.c
@@ -148,8 +148,10 @@ static int receive_chars_read(struct uart_port *port)
 			uart_handle_dcd_change(port, 1);
 		}
 
-		for (i = 0; i < bytes_read; i++)
-			uart_handle_sysrq_char(port, con_read_page[i]);
+		if (port->sysrq != 0 &&  *con_read_page) {
+			for (i = 0; i < bytes_read; i++)
+				uart_handle_sysrq_char(port, con_read_page[i]);
+		}
 
 		if (port->state == NULL)
 			continue;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH] tty/serial: Skip 'NULL' char after console break when sysrq enabled Vijay Kumar <vijay.ac.kumar@oracle.com> - 2015-12-23 20:00 +0100
  Re: [PATCH] tty/serial: Skip 'NULL' char after console break when  sysrq enabled David Miller <davem@davemloft.net> - 2015-12-24 17:50 +0100

csiph-web