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: 1491001 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 00D9A3FE65 for ; Fri, 21 Sep 2012 10:26:18 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TF0O3-0003PN-CP; Fri, 21 Sep 2012 10:23:07 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TF0Nz-0003Ol-1u for linux-arm-kernel@lists.infradead.org; Fri, 21 Sep 2012 10:23:04 +0000 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: 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 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -7.4 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.41 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: sourav.poddar@ti.com, linux-omap@vger.kernel.org, Shubhrajyoti D , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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;