Skip to content

Commit

Permalink
sunsab: Fix detection of BREAK on sunsab serial console
Browse files Browse the repository at this point in the history
[ Upstream commit fe41823 ]

Fix detection of BREAK on sunsab serial console: BREAK detection was only
performed when there were also serial characters received simultaneously.
To handle all BREAKs correctly, the check for BREAK and the corresponding
call to uart_handle_break() must also be done if count == 0, therefore
duplicate this code fragment and pull it out of the loop over the received
characters.

Patch applies to 3.16-rc6.

Signed-off-by: Christopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Christopher Alexander Tobias Schulze authored and Greg Kroah-Hartman committed Aug 14, 2014
1 parent 7554c49 commit a46e945
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/tty/serial/sunsab.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,15 @@ receive_chars(struct uart_sunsab_port *up,
(up->port.line == up->port.cons->index))
saw_console_brk = 1;

if (count == 0) {
if (unlikely(stat->sreg.isr1 & SAB82532_ISR1_BRK)) {
stat->sreg.isr0 &= ~(SAB82532_ISR0_PERR |
SAB82532_ISR0_FERR);
up->port.icount.brk++;
uart_handle_break(&up->port);
}
}

for (i = 0; i < count; i++) {
unsigned char ch = buf[i], flag;

Expand Down

0 comments on commit a46e945

Please sign in to comment.