Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754460AbbHQHXi (ORCPT ); Mon, 17 Aug 2015 03:23:38 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:35304 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751320AbbHQHWu (ORCPT ); Mon, 17 Aug 2015 03:22:50 -0400 From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu Cc: Anirudha Sarangi , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , Jiri Slaby , linux-serial@vger.kernel.org, Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/4] serial: xuartps: Do not enable parity error interrupt Date: Mon, 17 Aug 2015 09:22:33 +0200 Message-Id: X-Mailer: git-send-email 2.3.5 In-Reply-To: <5b154ba97bcd79e49e2131152eb2fc1761594a6c.1439796149.git.michal.simek@xilinx.com> References: <5b154ba97bcd79e49e2131152eb2fc1761594a6c.1439796149.git.michal.simek@xilinx.com> In-Reply-To: <5b154ba97bcd79e49e2131152eb2fc1761594a6c.1439796149.git.michal.simek@xilinx.com> References: <5b154ba97bcd79e49e2131152eb2fc1761594a6c.1439796149.git.michal.simek@xilinx.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2433 Lines: 53 From: Anirudha Sarangi 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: Anirudha Sarangi Signed-off-by: Michal Simek --- 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 c4437e8929ff..2dc26e5f1384 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -803,8 +803,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.3.5 -- 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/