]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sparc64: 'NULL' char after break when sysrq enabled
authorVijay Kumar <vijay.ac.kumar@oracle.com>
Wed, 23 Dec 2015 10:28:30 +0000 (02:28 -0800)
committerAllen Pais <allen.pais@oracle.com>
Wed, 23 Dec 2015 14:17:11 +0000 (19:47 +0530)
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 <vijay.ac.kumar@oracle.com>
Acked-by: Karl Volz <karl.volz@oracle.com>
(cherry picked from commit 30ae1c049f8720f93e2b36f084448f6dc370d30b)

drivers/tty/serial/sunhv.c

index 534754440fa8e90ada032a2f4246c0ffe00a403c..c694b8e6591d050421b7d5db3e22041f5aeccd09 100644 (file)
@@ -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;