From patchwork Fri Oct 20 21:20:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 10020969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5020160211 for ; Fri, 20 Oct 2017 21:21:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 417AB28F55 for ; Fri, 20 Oct 2017 21:21:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3361728F64; Fri, 20 Oct 2017 21:21:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A84FB28F55 for ; Fri, 20 Oct 2017 21:21:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=olk2+TOLtaXaou4dQKab6QN/yfa/GI1zOmHagNbO9bk=; b=D4aq4T1YtegCoSKv917dC0EAtJ YCxwmotMCIDNMolAuCCAcozPRJuKcaXQlGp0Gv61eFkz4NDzJfCIAUXg+9/djRWYyYRbvKFVFItzN kNqYQJrLdtsOruxWQz2LqvIjr/rlocL6+g4X2qBbzNaEHmX4GiYKPMz016nttCoY1LLfdxCx+w3G6 s8yZXlRK2ZA7Vx/WhY/r09SCNtkfQRK1WgZZkIMTxrq1NRUvIPdEe5JCJnWaC+o8yKLolnwQTkjEd r8nz7VrSgZTRHnTFqfaZVd96JE5NMx4Fen5IIRit3v7EuPb3PTaoo3hx3oPXl2ksKhDMJqZ/tvcPC DLCBhw4g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e5ejq-0003la-QQ; Fri, 20 Oct 2017 21:21:54 +0000 Received: from wsip-98-189-142-135.oc.oc.cox.net ([98.189.142.135] helo=office-server2) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e5eiq-00037n-WD for linux-arm-kernel@lists.infradead.org; Fri, 20 Oct 2017 21:20:56 +0000 Received: from tkisky by office-server2 with local (Exim 4.88) (envelope-from ) id 1e5eiN-0003PZ-Vp; Fri, 20 Oct 2017 14:20:24 -0700 From: Troy Kisky To: gregkh@linuxfoundation.org, nandor.han@ge.com Subject: [PATCH v2 3/3] tty: serial: imx: remove imx_disable_rx_int Date: Fri, 20 Oct 2017 14:20:21 -0700 Message-Id: <20171020212021.13065-3-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171020212021.13065-1-troy.kisky@boundarydevices.com> References: <20171020212021.13065-1-troy.kisky@boundarydevices.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171020_142053_083547_55673D48 X-CRM114-Status: UNSURE ( 9.71 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Troy Kisky , linux-serial@vger.kernel.org, u.kleine-koenig@pengutronix.de, fabio.estevam@nxp.com, linux-arm-kernel@lists.infradead.org, l.stach@pengutronix.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Since imx_disable_rx_int is only called by imx_startup, let's integrate it into that function. Signed-off-by: Troy Kisky --- v2: new patch --- drivers/tty/serial/imx.c | 39 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 15b0ecb4cf60..506fcd742b47 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -710,27 +710,6 @@ static irqreturn_t imx_rxint(int irq, void *dev_id) return IRQ_HANDLED; } -static void imx_disable_rx_int(struct imx_port *sport) -{ - unsigned long temp; - - sport->dma_is_rxing = 1; - - /* disable the receiver ready and aging timer interrupts */ - temp = readl(sport->port.membase + UCR1); - temp &= ~(UCR1_RRDYEN); - writel(temp, sport->port.membase + UCR1); - - temp = readl(sport->port.membase + UCR2); - temp &= ~(UCR2_ATEN); - writel(temp, sport->port.membase + UCR2); - - /* disable the rx errors interrupts */ - temp = readl(sport->port.membase + UCR4); - temp &= ~UCR4_OREN; - writel(temp, sport->port.membase + UCR4); -} - static void clear_rx_errors(struct imx_port *sport); /* @@ -1024,6 +1003,7 @@ static int start_rx_dma(struct imx_port *sport) struct dma_async_tx_descriptor *desc; int ret; + sport->dma_is_rxing = 1; sport->rx_ring.head = 0; sport->rx_ring.tail = 0; sport->rx_periods = RX_DMA_PERIODS; @@ -1260,18 +1240,21 @@ static int imx_startup(struct uart_port *port) if (sport->dma_is_inited && !sport->dma_is_enabled) imx_enable_dma(sport); - temp = readl(sport->port.membase + UCR1); - temp |= UCR1_RRDYEN | UCR1_UARTEN; + temp = readl(sport->port.membase + UCR1) & ~UCR1_RRDYEN; + if (!sport->dma_is_enabled) + temp |= UCR1_RRDYEN; + temp |= UCR1_UARTEN; if (sport->have_rtscts) temp |= UCR1_RTSDEN; writel(temp, sport->port.membase + UCR1); - temp = readl(sport->port.membase + UCR4); - temp |= UCR4_OREN; + temp = readl(sport->port.membase + UCR4) & ~UCR4_OREN; + if (!sport->dma_is_enabled) + temp |= UCR4_OREN; writel(temp, sport->port.membase + UCR4); - temp = readl(sport->port.membase + UCR2); + temp = readl(sport->port.membase + UCR2) & ~UCR2_ATEN; temp |= (UCR2_RXEN | UCR2_TXEN); if (!sport->have_rtscts) temp |= UCR2_IRTS; @@ -1305,10 +1288,8 @@ static int imx_startup(struct uart_port *port) * In our iMX53 the average delay for the first reception dropped from * approximately 35000 microseconds to 1000 microseconds. */ - if (sport->dma_is_enabled) { - imx_disable_rx_int(sport); + if (sport->dma_is_enabled) start_rx_dma(sport); - } spin_unlock_irqrestore(&sport->port.lock, flags);