]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.4.103/sunsab-fix-detection-of-break-on-sunsab-serial-console.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.4.103 / sunsab-fix-detection-of-break-on-sunsab-serial-console.patch
1 From foo@baz Thu Aug 7 22:33:35 PDT 2014
2 From: Christopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net>
3 Date: Sun, 3 Aug 2014 16:01:53 +0200
4 Subject: sunsab: Fix detection of BREAK on sunsab serial console
5
6 From: Christopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net>
7
8 [ Upstream commit fe418231b195c205701c0cc550a03f6c9758fd9e ]
9
10 Fix detection of BREAK on sunsab serial console: BREAK detection was only
11 performed when there were also serial characters received simultaneously.
12 To handle all BREAKs correctly, the check for BREAK and the corresponding
13 call to uart_handle_break() must also be done if count == 0, therefore
14 duplicate this code fragment and pull it out of the loop over the received
15 characters.
16
17 Patch applies to 3.16-rc6.
18
19 Signed-off-by: Christopher Alexander Tobias Schulze <cat.schulze@alice-dsl.net>
20 Signed-off-by: David S. Miller <davem@davemloft.net>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 ---
23 drivers/tty/serial/sunsab.c | 9 +++++++++
24 1 file changed, 9 insertions(+)
25
26 --- a/drivers/tty/serial/sunsab.c
27 +++ b/drivers/tty/serial/sunsab.c
28 @@ -157,6 +157,15 @@ receive_chars(struct uart_sunsab_port *u
29 (up->port.line == up->port.cons->index))
30 saw_console_brk = 1;
31
32 + if (count == 0) {
33 + if (unlikely(stat->sreg.isr1 & SAB82532_ISR1_BRK)) {
34 + stat->sreg.isr0 &= ~(SAB82532_ISR0_PERR |
35 + SAB82532_ISR0_FERR);
36 + up->port.icount.brk++;
37 + uart_handle_break(&up->port);
38 + }
39 + }
40 +
41 for (i = 0; i < count; i++) {
42 unsigned char ch = buf[i], flag;
43