From patchwork Mon Aug 17 07:22:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 7023761 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 878C59F358 for ; Mon, 17 Aug 2015 07:25:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B24FB20601 for ; Mon, 17 Aug 2015 07:25:14 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DC533204E7 for ; Mon, 17 Aug 2015 07:25:13 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZRElY-0008HU-GU; Mon, 17 Aug 2015 07:23:32 +0000 Received: from mail-wi0-f179.google.com ([209.85.212.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZRElD-0007tj-47 for linux-arm-kernel@lists.infradead.org; Mon, 17 Aug 2015 07:23:12 +0000 Received: by wijp15 with SMTP id p15so66788705wij.0 for ; Mon, 17 Aug 2015 00:22:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:in-reply-to:references; bh=94gAHyzSr7ma5RhoBxWsvPq5BaQhG6IWqpqGUNVhXy0=; b=Kp0V449QCvH97jNuXBee2eQ88jJgV+Am6msw2l2AGpKSyejlNMfiQX771WlqXyX199 asmxT4F98WZVNL/PrSZNQuVZVf8fLIg2q/KJodJnUNCG4oxycP/l0t0ks8TazGIS/Ctm iniRG/TvYLRtKYb+fCHd/fZEJaiWe5l7FrWriCrC982TVtawTqpeh3l47VeuY09UWs5d fM+U+RPPyZ3m3BBRaq2YfQVZJQ1T/vL0JV30K6pazyCeXBF2qjcoS2bBmdWDhlVEht+e RxQYSxDY6IfRP6kGbj+GLJu1EAofENdg2GKPe2Y9uttlN1ayhQfym2eNNzb9TtLCuref 1S9g== X-Gm-Message-State: ALoCoQnf/VZyZgOE3aBkj4M9y/CH92P9ct5OZgUJUWwW1XwyzgKRybhJuHXR2A6kp/0ZafUZZCIP X-Received: by 10.180.99.193 with SMTP id es1mr31824061wib.29.1439796169327; Mon, 17 Aug 2015 00:22:49 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id bu12sm20489870wjb.44.2015.08.17.00.22.48 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 17 Aug 2015 00:22:48 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150817_002311_375354_B0CEC04E X-CRM114-Status: GOOD ( 13.45 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anirudha Sarangi , Jiri Slaby , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , linux-serial@vger.kernel.org, Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);