aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVijay Kumar <vijay.ac.kumar@oracle.com>2015-12-23 13:55:33 -0500
committerDavid S. Miller <davem@davemloft.net>2015-12-24 12:13:37 -0500
commit079317a65d05ce52b69b7d47fe1fb419d40a4395 (patch)
tree6252b2ec2b3eaf65d87fd506086e8ff314ed2de4
parenta7c5724b5c17775ca8ea2fd9906d8a7e37337cce (diff)
tty/serial: Skip 'NULL' char after console break when sysrq enabled
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> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/tty/serial/sunhv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c
index f224e8a715d7..ca0d3802f2af 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)
148 uart_handle_dcd_change(port, 1); 148 uart_handle_dcd_change(port, 1);
149 } 149 }
150 150
151 for (i = 0; i < bytes_read; i++) 151 if (port->sysrq != 0 && *con_read_page) {
152 uart_handle_sysrq_char(port, con_read_page[i]); 152 for (i = 0; i < bytes_read; i++)
153 uart_handle_sysrq_char(port, con_read_page[i]);
154 }
153 155
154 if (port->state == NULL) 156 if (port->state == NULL)
155 continue; 157 continue;