From patchwork Thu Sep 21 16:18:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martyn Welch X-Patchwork-Id: 9964249 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 EAC4C6020C for ; Thu, 21 Sep 2017 16:20:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D70C22958E for ; Thu, 21 Sep 2017 16:20:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBBDA2958D; Thu, 21 Sep 2017 16:20:24 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY 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 5779729550 for ; Thu, 21 Sep 2017 16:20:24 +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=75+NAFbeV+74HJ75HUIGSXQp1K1PZ+bnWudMlssjjfY=; b=afSgHDI2/VczsErOZcdgU+r9dD 2knTB5Q7w0YDufwEu6iaUrh6es1Hlkjgc2049WWGzk/RH5gTMRKaiGkxUgNRXgTqkQMbD2btmeZsX NRJXafR//wlDcPuQwQGwIYkHvFak82pZu+TvFlkgPkA3XJ/UAOBZG/rDQWw1cYDrhd53DOHPF/sOQ YqLvSh70EWTRV5Vbxp4tSOYQSJp/nhd30MFSGcn6eCR1Xx3o5tdk2KzfVWqSVY++zcloMzPrbeWAw dEjO1WoCy9y6cSDnAKruJO593p4F2VQI8i9rSnl4L2JwM52pl50p/fO/sYxAoRoeAV2ybGJ2pBF2h aFADYrIA==; 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 1dv4Cq-0003nr-Er; Thu, 21 Sep 2017 16:20:04 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dv4Bj-0002Q8-AU for linux-arm-kernel@lists.infradead.org; Thu, 21 Sep 2017 16:18:59 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: martyn) with ESMTPSA id 73109267AD8 Received: by kratos.localdomain (Postfix, from userid 1000) id D6978201CD6D1; Thu, 21 Sep 2017 17:18:22 +0100 (BST) From: Martyn Welch To: Greg Kroah-Hartman Subject: [PATCH v3 1/6] serial: imx: remove CTSC and CTS handling from imx_disable_dma Date: Thu, 21 Sep 2017 17:18:12 +0100 Message-Id: <1506010697-22114-2-git-send-email-martyn.welch@collabora.co.uk> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1506010697-22114-1-git-send-email-martyn.welch@collabora.co.uk> References: <1506010697-22114-1-git-send-email-martyn.welch@collabora.co.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170921_091855_609543_4DFCAA87 X-CRM114-Status: GOOD ( 12.23 ) 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: Martyn Welch , Nandor Han , linux-kernel@vger.kernel.org, Fabio Estevam , linux-serial@vger.kernel.org, u.kleine-koenig@pengutronix.de, Romain Perier , 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-Virus-Scanned: ClamAV using ClamSMTP From: Nandor Han The CTSC and CTS bits affect operation of the CTS/RTS hardware flow control signal (depending on whether the device is in DCE or DTE mode) and are not related to DMA. When in RS-232 mode, the driver is using the automatic CTSC control based on a rxFIFO fill level unless the state of the CTS signal is explictly set via an ioctl call. Previous improvements to the imx serial driver have resulted on imx_disable_dma() only being called on shutdown, by which point the serial core has already correctly deasserted CTS. Testing shows that without this handling in imx_disable_dma() the CTS signal state is set correctly when the device is open and TIOCM_RTS is set/cleared via the TIOCMGET ioctl. The CTS signal is also correctly deasserted when the device file is closed. When in RS-485 mode, the driver uses the CTS signal very differently and appears to control it via calls to imx_port_rts_active() and imx_port_rts_inactive(). This configuration of the CTSC and CTS bits are therefore not needed. Signed-off-by: Nandor Han Signed-off-by: Romain Perier Signed-off-by: Martyn Welch --- drivers/tty/serial/imx.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index fe368a4..d90dae3 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1225,11 +1225,6 @@ static void imx_disable_dma(struct imx_port *sport) temp &= ~(UCR1_RDMAEN | UCR1_TDMAEN | UCR1_ATDMAEN); writel(temp, sport->port.membase + UCR1); - /* clear UCR2 */ - temp = readl(sport->port.membase + UCR2); - temp &= ~(UCR2_CTSC | UCR2_CTS | UCR2_ATEN); - writel(temp, sport->port.membase + UCR2); - imx_setup_ufcr(sport, TXTL_DEFAULT, RXTL_DEFAULT); sport->dma_is_enabled = 0;