Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1736996

Re: [PATCH v3 1/6] serial: imx: remove CTSC and CTS handling from imx_disable_dma

Path csiph.com!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!bofh.it!news.nic.it!robomod
From Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH v3 1/6] serial: imx: remove CTSC and CTS handling from imx_disable_dma
Date Thu, 21 Sep 2017 20:30:01 +0200
Message-ID <useox-4rm-5@gated-at.bofh.it> (permalink)
References <uscmJ-3iX-3@gated-at.bofh.it> <uscwp-3m1-11@gated-at.bofh.it>
MIME-Version 1.0
Content-Type text/plain; charset=iso-8859-1
Content-Disposition inline
Content-Transfer-Encoding 8bit
User-Agent NeoMutt/20170113 (1.7.2)
X-Sa-Exim-Connect-IP 2001:67c:670:100:5054:ff:fe2a:3aa
X-Sa-Exim-Mail-From ukl@pengutronix.de
X-Sa-Exim-Scanned No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false
X-Ptx-Original-Recipient linux-kernel@vger.kernel.org
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 56
Organization linux.* mail to news gateway
X-Original-Cc Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Nandor Han <nandor.han@ge.com>, Romain Perier <romain.perier@collabora.com>, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Fabio Estevam <fabio.estevam@nxp.com>
X-Original-Date Thu, 21 Sep 2017 20:20:17 +0200
X-Original-Message-ID <20170921182017.t7c75tyy66q7q3ns@pengutronix.de>
X-Original-References <1506010697-22114-1-git-send-email-martyn.welch@collabora.co.uk> <1506010697-22114-2-git-send-email-martyn.welch@collabora.co.uk>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1736996

Show key headers only | View raw


On Thu, Sep 21, 2017 at 05:18:12PM +0100, Martyn Welch wrote:
> From: Nandor Han <nandor.han@ge.com>
> 
> 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.

With that block kept CTS set once more to inactive. So the block doesn't
hurt and is "only" superflous, right?

> 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 <nandor.han@ge.com>
> Signed-off-by: Romain Perier <romain.perier@collabora.com>
> Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
> ---
>  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);

The commit log doesn't mention ATEN, I guess that one just doesn't
matter any more at this stage? Would be nice to point out though.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/6] serial: imx: various improvements Martyn Welch <martyn.welch@collabora.co.uk> - 2017-09-21 18:20 +0200
  [PATCH v3 3/6] serial: imx: Simplify DMA disablement Martyn Welch <martyn.welch@collabora.co.uk> - 2017-09-21 18:20 +0200
  [PATCH v3 6/6] serial: imx: Fix imx_shutdown procedure Martyn Welch <martyn.welch@collabora.co.uk> - 2017-09-21 18:20 +0200
  [PATCH v3 4/6] serial: imx: unmap sg buffers when DMA channel is released Martyn Welch <martyn.welch@collabora.co.uk> - 2017-09-21 18:20 +0200
    Re: [PATCH v3 4/6] serial: imx: unmap sg buffers when DMA channel is  released Uwe Kleine-König          <u.kleine-koenig@pengutronix.de> - 2017-09-21 20:30 +0200
  [PATCH v3 1/6] serial: imx: remove CTSC and CTS handling from imx_disable_dma Martyn Welch <martyn.welch@collabora.co.uk> - 2017-09-21 18:30 +0200
    Re: [PATCH v3 1/6] serial: imx: remove CTSC and CTS handling from  imx_disable_dma Uwe Kleine-König          <u.kleine-koenig@pengutronix.de> - 2017-09-21 20:30 +0200
      Re: [PATCH v3 1/6] serial: imx: remove CTSC and CTS handling from  imx_disable_dma Martyn Welch <martyn.welch@collabora.co.uk> - 2017-09-21 21:20 +0200

csiph-web