Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161207AbbKTNug (ORCPT ); Fri, 20 Nov 2015 08:50:36 -0500 Received: from mail-sn1nam02on0053.outbound.protection.outlook.com ([104.47.36.53]:37760 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752076AbbKTNue (ORCPT ); Fri, 20 Nov 2015 08:50:34 -0500 X-Greylist: delayed 941 seconds by postgrey-1.27 at vger.kernel.org; Fri, 20 Nov 2015 08:50:34 EST Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; From: Nava kishore Manne To: , , , CC: , , , Nava kishore Manne Subject: [PATCH v2 3/3] serial: xuartps: Do not enable parity error interrupt Date: Fri, 20 Nov 2015 19:04:38 +0530 Message-ID: <1448026478-22131-3-git-send-email-navam@xilinx.com> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1448026478-22131-1-git-send-email-navam@xilinx.com> References: <1448026478-22131-1-git-send-email-navam@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21952.006 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.100;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(199003)(189002)(50986999)(586003)(19580395003)(87936001)(4001430100002)(33646002)(5008740100001)(48376002)(36386004)(6806005)(90966002)(45336002)(4001450100002)(5003940100001)(92566002)(63266004)(11100500001)(103686003)(5007970100001)(5001920100001)(81156007)(2950100001)(46386002)(5001960100002)(189998001)(107886002)(76176999)(5001770100001)(42186005)(47776003)(50226001)(50466002)(52956003)(19580405001)(106466001)(229853001)(86362001)(2201001)(36756003)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2NAM02HT104;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501001);SRVR:BL2NAM02HT104; X-Microsoft-Antispam-PRVS: <5179f9ebd65d4bec8e96e9492d857c9b@BL2NAM02HT104.eop-nam02.prod.protection.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(10201501046)(3002001);SRVR:BL2NAM02HT104;BCL:0;PCL:0;RULEID:;SRVR:BL2NAM02HT104; X-Forefront-PRVS: 07665BE9D1 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2015 13:35:02.0399 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2NAM02HT104 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2340 Lines: 52 The patch makes changes not to enable parity error interrupt. With the current implementation, each parity error results in two distinct interrupts (almost always). The first one is normal parity error interrupt with no data in the fifo and the second one is a proper Rx interrupt with the received data in the fifo. By disabling parity error interrupt we still ensure handling of parity errors as for the Rx fifo interrupt the parity error still shows up in the interrupt status register. Considering the fact that the by default INPCK and IGNPAR are not set, this is the optimal implementation for parity error handling. Signed-off-by: Nava kishore Manne --- Changes for v2: --None drivers/tty/serial/xilinx_uartps.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 4d71478..082e7f7 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -824,8 +824,18 @@ static int cdns_uart_startup(struct uart_port *port) writel(readl(port->membase + CDNS_UART_ISR_OFFSET), port->membase + CDNS_UART_ISR_OFFSET); - /* Set the Interrupt Registers with desired interrupts */ - writel(CDNS_UART_IXR_TXEMPTY | CDNS_UART_IXR_PARITY | + /* + * Set the Interrupt Registers with desired interrupts. Do not + * enable parity error interrupt for the following reason: + * When parity error interrupt is enabled, each Rx parity error always + * results in 2 events. The first one being parity error interrupt + * and the second one with a proper Rx interrupt with the incoming data. + * Disabling parity error interrupt ensures better handling of parity + * error events. With this change, for a parity error case, we get a + * Rx interrupt with parity error set in ISR register and we still + * handle parity errors in the desired way. + */ + writel(CDNS_UART_IXR_TXEMPTY | CDNS_UART_IXR_FRAMING | CDNS_UART_IXR_OVERRUN | CDNS_UART_IXR_RXTRIG | CDNS_UART_IXR_TOUT, port->membase + CDNS_UART_IER_OFFSET); -- 2.1.2 -- 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/