From patchwork Fri Sep 21 14:37:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhrajyoti Datta X-Patchwork-Id: 1491801 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 E360B3FE65 for ; Fri, 21 Sep 2012 14:37:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754881Ab2IUOha (ORCPT ); Fri, 21 Sep 2012 10:37:30 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:54001 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754221Ab2IUOh3 (ORCPT ); Fri, 21 Sep 2012 10:37:29 -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 q8LEbPpx005148; Fri, 21 Sep 2012 09:37:25 -0500 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8LEbOPf026009; Fri, 21 Sep 2012 20:07:24 +0530 (IST) Received: from dbdp33.itg.ti.com (172.24.170.252) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Fri, 21 Sep 2012 20:07:23 +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 q8LEbLKP020694; Fri, 21 Sep 2012 20:07:22 +0530 From: Shubhrajyoti D To: CC: , , Shubhrajyoti D Subject: [PATCH v2] serial: omap: fix the reciever line error case Date: Fri, 21 Sep 2012 20:07:19 +0530 Message-ID: <1348238239-18510-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 This patch does the following - In case of errors if there least one data character in the RX FIFO read it otherwise it may stall the receiver. This is recommended in the interrupt reset method in the table 23-246 of the omap4 TRM. Signed-off-by: Shubhrajyoti D Reviewed-by: Felipe Balbi Tested-by: Kevin Hilman --- - Tested on omap4sdp. - pm tested hitting off in idle and suspend. - v2 changes update the changelogs. - Also remove the dummy check as FE , PE , BI and OE are the only receiver errors. drivers/tty/serial/omap-serial.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index a0d4460..4fea16b 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -334,6 +334,10 @@ 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 (likely(lsr & UART_LSR_DR)) + ch = serial_in(up, UART_RX); up->port.icount.rx++; flag = TTY_NORMAL;