diff options
author | Johan Hovold <johan@kernel.org> | 2014-11-18 11:25:21 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2014-12-14 16:23:58 +0000 |
commit | d22659769a8f602e08a6906623f0854dddc2d240 (patch) | |
tree | 03ef356c19f133c9b8962fa4ec875ce95260f225 /drivers | |
parent | 1e8d16df963f66009f0453ae2b29a26fb356e285 (diff) |
USB: ssu100: fix overrun-error reporting
commit 75bcbf29c284dd0154c3e895a0bd1ef0e796160e upstream.
Fix reporting of overrun errors, which should only be reported once
using the inserted null character.
Fixes: 6b8f1ca5581b ("USB: ssu100: set tty_flags in ssu100_process_packet")
Signed-off-by: Johan Hovold <johan@kernel.org>
[bwh: Backported to 3.2:
- Use tty_port_tty_get() to look up tty_struct
- Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/serial/ssu100.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c index bf1f8ea989b0..ad8e5f36f54a 100644 --- a/drivers/usb/serial/ssu100.c +++ b/drivers/usb/serial/ssu100.c @@ -599,10 +599,10 @@ static void ssu100_update_lsr(struct usb_serial_port *port, u8 lsr, if (*tty_flag == TTY_NORMAL) *tty_flag = TTY_FRAME; } - if (lsr & UART_LSR_OE){ + if (lsr & UART_LSR_OE) { priv->icount.overrun++; - if (*tty_flag == TTY_NORMAL) - *tty_flag = TTY_OVERRUN; + tty_insert_flip_char(tty_port_tty_get(&port->port), + 0, TTY_OVERRUN); } } @@ -623,11 +623,8 @@ static int ssu100_process_packet(struct urb *urb, if ((len >= 4) && (packet[0] == 0x1b) && (packet[1] == 0x1b) && ((packet[2] == 0x00) || (packet[2] == 0x01))) { - if (packet[2] == 0x00) { + if (packet[2] == 0x00) ssu100_update_lsr(port, packet[3], &flag); - if (flag == TTY_OVERRUN) - tty_insert_flip_char(tty, 0, TTY_OVERRUN); - } if (packet[2] == 0x01) ssu100_update_msr(port, packet[3]); |