Commit d2265976 authored by Johan Hovold's avatar Johan Hovold Committed by Ben Hutchings

USB: ssu100: fix overrun-error reporting

commit 75bcbf29 upstream.

Fix reporting of overrun errors, which should only be reported once
using the inserted null character.

Fixes: 6b8f1ca5 ("USB: ssu100: set tty_flags in ssu100_process_packet")
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
[bwh: Backported to 3.2:
 - Use tty_port_tty_get() to look up tty_struct
 - Adjust context]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 1e8d16df
......@@ -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]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment