Skip to content

Commit

Permalink
serial: st-asc: Fix SysRq char handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daniel Thompson authored and Greg Kroah-Hartman committed Apr 16, 2014
1 parent 2f310b8 commit c3c00b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/tty/serial/st-asc.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ static void asc_receive_chars(struct uart_port *port)
status & ASC_STA_OE) {

if (c & ASC_RXBUF_FE) {
if (c == ASC_RXBUF_FE) {
if (c == (ASC_RXBUF_FE | ASC_RXBUF_DUMMY_RX)) {
port->icount.brk++;
if (uart_handle_break(port))
continue;
Expand Down Expand Up @@ -325,7 +325,7 @@ static void asc_receive_chars(struct uart_port *port)
flag = TTY_FRAME;
}

if (uart_handle_sysrq_char(port, c))
if (uart_handle_sysrq_char(port, c & 0xff))
continue;

uart_insert_char(port, c, ASC_RXBUF_DUMMY_OE, c & 0xff, flag);
Expand Down

0 comments on commit c3c00b6

Please sign in to comment.