From patchwork Fri Sep 21 10:22:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 1490981 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 48FE2400ED for ; Fri, 21 Sep 2012 10:23:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754995Ab2IUKXL (ORCPT ); Fri, 21 Sep 2012 06:23:11 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:40797 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754567Ab2IUKXF (ORCPT ); Fri, 21 Sep 2012 06:23:05 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id q8LAN0aV011264; Fri, 21 Sep 2012 05:23:01 -0500 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8LAMxa1021772; Fri, 21 Sep 2012 15:52:59 +0530 (IST) Received: from dbdp33.itg.ti.com (172.24.170.252) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Fri, 21 Sep 2012 15:52:59 +0530 Received: from ula0393217.india.ti.com (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp33.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8LAMwBt007417; Fri, 21 Sep 2012 15:52:58 +0530 From: Shubhrajyoti D To: CC: , , , Shubhrajyoti D Subject: [PATCH] serial: omap: fix the overrun case Date: Fri, 21 Sep 2012 15:52:56 +0530 Message-ID: <1348222976-7241-1-git-send-email-shubhrajyoti@ti.com> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Overrun also causes an internal flag to be set, which disables further reception. Before the next frame can be received, the MPU must: • Reset the RX FIFO. • clear the internal flag. In the uart mode a dummy read is needed. Add the same. Signed-off-by: Shubhrajyoti D Tested-by: Kevin Hilman --- - functional testing on omap4sdp - Verified idle and suspend path hits off on beagle. drivers/tty/serial/omap-serial.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index a0d4460..bc22a2b 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -334,6 +334,13 @@ static unsigned int check_modem_status(struct uart_omap_port *up) static void serial_omap_rlsi(struct uart_omap_port *up, unsigned int lsr) { unsigned int flag; + unsigned char ch = 0; + + if (!(lsr & UART_LSR_BRK_ERROR_BITS)) + return; + + if (likely(lsr & UART_LSR_DR)) + ch = serial_in(up, UART_RX); up->port.icount.rx++; flag = TTY_NORMAL;