aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/st-asc.c
diff options
context:
space:
mode:
authorDaniel Thompson <daniel.thompson@linaro.org>2014-03-28 06:53:10 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-16 17:17:44 -0400
commitc3c00b6f7f79be1dd1aa0969ee0ab7d1f79eda79 (patch)
tree0041fb4aa589d40bd5fed5f21b24e550dcf3e0bc /drivers/tty/serial/st-asc.c
parent2f310b8e418ac5eb3833a9f36791c24a97f1f557 (diff)
serial: st-asc: Fix SysRq char handling
This driver, like several others, uses the upper bits of the character to track both real and dummy state. Unfortunately it neglects to mask these bits properly when passing the character data around. This means neither break detection nor sysrq character handling work correctly. This patch adds the requires masking and has been tested to confirm that it correctly handles magic sysrq sequences on ST's B2020 board. Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/st-asc.c')
-rw-r--r--drivers/tty/serial/st-asc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
index 21e6e84c0df8..dd3a96e07026 100644
--- a/drivers/tty/serial/st-asc.c
+++ b/drivers/tty/serial/st-asc.c
@@ -295,7 +295,7 @@ static void asc_receive_chars(struct uart_port *port)
295 status & ASC_STA_OE) { 295 status & ASC_STA_OE) {
296 296
297 if (c & ASC_RXBUF_FE) { 297 if (c & ASC_RXBUF_FE) {
298 if (c == ASC_RXBUF_FE) { 298 if (c == (ASC_RXBUF_FE | ASC_RXBUF_DUMMY_RX)) {
299 port->icount.brk++; 299 port->icount.brk++;
300 if (uart_handle_break(port)) 300 if (uart_handle_break(port))
301 continue; 301 continue;
@@ -325,7 +325,7 @@ static void asc_receive_chars(struct uart_port *port)
325 flag = TTY_FRAME; 325 flag = TTY_FRAME;
326 } 326 }
327 327
328 if (uart_handle_sysrq_char(port, c)) 328 if (uart_handle_sysrq_char(port, c & 0xff))
329 continue; 329 continue;
330 330
331 uart_insert_char(port, c, ASC_RXBUF_DUMMY_OE, c & 0xff, flag); 331 uart_insert_char(port, c, ASC_RXBUF_DUMMY_OE, c & 0xff, flag);