From: Vijay Kumar Date: Wed, 23 Dec 2015 10:28:30 +0000 (-0800) Subject: sparc64: 'NULL' char after break when sysrq enabled X-Git-Tag: v4.1.12-92~198^2~12 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9b7c51327158b00ff7d3b67f6878f33255ff6ede;p=users%2Fjedix%2Flinux-maple.git sparc64: 'NULL' char after 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. Orabug: 22456721 Signed-off-by: Vijay Kumar Acked-by: Karl Volz (cherry picked from commit 30ae1c049f8720f93e2b36f084448f6dc370d30b) --- diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c index 534754440fa8e..c694b8e6591d0 100644 --- a/drivers/tty/serial/sunhv.c +++ b/drivers/tty/serial/sunhv.c @@ -149,8 +149,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;