Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935413AbbDIKQ0 (ORCPT ); Thu, 9 Apr 2015 06:16:26 -0400 Received: from mail.kernel.org ([198.145.29.136]:40564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932820AbbDIIuC (ORCPT ); Thu, 9 Apr 2015 04:50:02 -0400 From: lizf@kernel.org To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Johan Hovold , Zefan Li Subject: [PATCH 3.4 007/176] USB: ssu100: fix overrun-error reporting Date: Thu, 9 Apr 2015 16:44:15 +0800 Message-Id: <1428569224-23820-7-git-send-email-lizf@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1428569028-23762-1-git-send-email-lizf@kernel.org> References: <1428569028-23762-1-git-send-email-lizf@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1918 Lines: 61 From: Johan Hovold 3.4.107-rc1 review patch. If anyone has any objections, please let me know. ------------------ 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 [lizf: Backported to 3.4: - adjust context - lookup tty using tty_port_tty_get()] Signed-off-by: Zefan Li --- drivers/usb/serial/ssu100.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c index d19fa6a..f425507 100644 --- a/drivers/usb/serial/ssu100.c +++ b/drivers/usb/serial/ssu100.c @@ -598,10 +598,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); } } @@ -622,11 +622,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]); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/