From patchwork Mon Apr 11 08:19:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12808692 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 87F17C433EF for ; Mon, 11 Apr 2022 08:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=vunsZ3kOtJZ8COLLP2Y7abNAmLAKbujqNRr3x6I10iY=; b=x4Tbd1SnD78Rn/ dUsZ3o3y5PASZrSUnOq1fkthVHeo8uV0T+X+TmaAfhgjjtWMck6pnJEqcWg9EEswQ70uhe9+lph4Y FY9wHlUWqaWt8u1Jb5gB8UlxCl8G/mD+cdb79lfWPuPNWJdrbICqOnDt1KDs7cZPgDr+A2Yj9dWrb 2TFQuzCnMyh1e67ZyGtAK+npH5vTGX0YQwZx7a5ftfU93vVTrr5uD57hGXOh7Y93L1tsxUrJSNMv7 QZfFZ4ievLL/Z0/y2N/PtZQ45vT2v4lhgzciR/Q359AzFTNqoyV4xW44hvL0U20lklGTPvcCSDcaS IQ6Ty70ZWiUR2hnslajg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndpIh-007Vl4-Kb; Mon, 11 Apr 2022 08:21:31 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ndpIe-007Vk0-C1 for linux-arm-kernel@lists.infradead.org; Mon, 11 Apr 2022 08:21:29 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7225A6150F; Mon, 11 Apr 2022 08:21:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1856C385A3; Mon, 11 Apr 2022 08:21:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649665286; bh=4+LOnSStvWlAPl01BPsjosP7fQbotLCvIhbQuoTuxEI=; h=From:To:Cc:Subject:Date:From; b=PhYufBekLXyrTi8xBJ3iWg0X58bvoSJ+Z3uBXUXl0rxUZH++UQ5mxSjQbmaqXwLSe WplY5qSXzTgFd6ZhrtO0LEbEAcpHp6veVQJjhcRLeFLpKGb0bBbjwzsB+rle5DHuga R+Q6J+Z0DZ/uvf7/ryr34i717ksxZrHfKodU7veh6MS97ETS5Eg14mDm8Yt0+Cf8ln 7EQvXu2N9DMRgcFfFgKa3LRB8iVVYsph4/h0wHMu8K7W4c3efos7Ig58hGcjsJk/qr 2Hga8mHvMO9J9lFedQGsaShc21aI34SLCZccTvW6Zn6SymTs3qxfMPADNnXsqJ7XIj AXuol3yqUtTdw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1ndpIW-00023s-1E; Mon, 11 Apr 2022 10:21:20 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= Subject: [PATCH] serial: imx: fix overrun interrupts in DMA mode Date: Mon, 11 Apr 2022 10:19:57 +0200 Message-Id: <20220411081957.7846-1-johan@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220411_012128_486619_F1B1D71B X-CRM114-Status: GOOD ( 14.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit 76821e222c18 ("serial: imx: ensure that RX irqs are off if RX is off") accidentally enabled overrun interrupts unconditionally when deferring DMA enable until after the receiver has been enabled during startup. Fix this by using the DMA-initialised instead of DMA-enabled flag to determine whether overrun interrupts should be enabled. Note that overrun interrupts are already accounted for in imx_uart_clear_rx_errors() when using DMA since commit 41d98b5da92f ("serial: imx-serial - update RX error counters when DMA is used"). Fixes: 76821e222c18 ("serial: imx: ensure that RX irqs are off if RX is off") Cc: stable@vger.kernel.org # 4.17 Cc: Uwe Kleine-König Signed-off-by: Johan Hovold --- drivers/tty/serial/imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index fd38e6ed4fda..a2100be8d554 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1448,7 +1448,7 @@ static int imx_uart_startup(struct uart_port *port) imx_uart_writel(sport, ucr1, UCR1); ucr4 = imx_uart_readl(sport, UCR4) & ~(UCR4_OREN | UCR4_INVR); - if (!sport->dma_is_enabled) + if (!dma_is_inited) ucr4 |= UCR4_OREN; if (sport->inverted_rx) ucr4 |= UCR4_INVR;