Received: by 10.192.165.148 with SMTP id m20csp4180928imm; Tue, 8 May 2018 04:27:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqi6tXKwglqcPWEfNfjmpNwblaRAeUGGBipLy+K7xZ5jaFKUr53OuLX3oMAQHHkUS+d/k/C X-Received: by 2002:a63:2c13:: with SMTP id s19-v6mr18412077pgs.427.1525778879144; Tue, 08 May 2018 04:27:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525778879; cv=none; d=google.com; s=arc-20160816; b=KfzSf/DkcvpZO4UNMxf6jxSik7+zfeGxVFRSN1KpGvCRHsVo2RwQ80NAEXGPu+tZ+u wKDuJssx/LdF6eFkp08yBs0GU2BvY5G5E+OUCYp0m3p+LOk6ys3UH4/xIByvegVko6kR hKcDRYi/5mwjfv5EAUT11QykRcDFtPDSP7G6oCSDs9HlQimd7VUB8jjtVerqGKotwuq+ jZowpRWdKgzalFSjtPj/OTKT0GldMSSAqg6r9Ix4K3/SYxQQJqKLMDsBuRTJlF6fecCt pMfDc4OHhtJkYRUMIDp8oh/NqtQDXVSNLdEc6tLbpZEP0gBk9Medw90XCO+unKiRttkC CX1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=uT5hikno6VMcRPAboaKx/3DQFEiNAJ+64WcteDyyehQ=; b=gWH8MBp2luuOhaEOpvj7FV5t1+IbLm/fgnzDB2Hrhv5YUlmMsBEmOUIi0GVZix05Hu 8L6+5lz5V2fIbixtLeqS5QL4NT+ZvveSKktDH686qR9pt9kKv5rnCnTvhDI+/eY6V9f3 7pV6OqPuHPtSQvhzd3lkHibh+wPIiC4KAi9AVgq3O/A4F/mNt5NeivbRkzN6qW5s5kng 7bD6gHM2oJCCmJrpjn70Ml0xpEitqkwsiRfBsHrdNpcVEBraScCa5zw6zobGMZ6lNYpr q8ZF4UndbMv/3Wmp+Z15wbvX7qjR3DZmbTG0QRcuErhFWWE9zc2QWNXrqXd+QfX6PoZf TI1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 70-v6si23769108ple.372.2018.05.08.04.27.44; Tue, 08 May 2018 04:27:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754763AbeEHL1b (ORCPT + 99 others); Tue, 8 May 2018 07:27:31 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:48218 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754540AbeEHL1a (ORCPT ); Tue, 8 May 2018 07:27:30 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 84EF32639EF Date: Tue, 8 May 2018 13:27:26 +0200 From: Sebastian Reichel To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= Cc: Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, Fabio Estevam , Shawn Guo , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] serial: imx: cleanup imx_uart_disable_dma() Message-ID: <20180508112726.nyxrebcuwwdq5npy@earth.universe> References: <20180507213610.17330-1-sebastian.reichel@collabora.co.uk> <20180507213610.17330-2-sebastian.reichel@collabora.co.uk> <20180508064047.v7wz7b4t5ta55hv7@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="hldlbuxw4kvqlosc" Content-Disposition: inline In-Reply-To: <20180508064047.v7wz7b4t5ta55hv7@pengutronix.de> User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --hldlbuxw4kvqlosc Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Tue, May 08, 2018 at 08:40:47AM +0200, Uwe Kleine-K=F6nig wrote: > On Mon, May 07, 2018 at 11:36:09PM +0200, Sebastian Reichel wrote: > > Remove unrelated CTSC/CTS disabling from imx_uart_disable_dma() and > > move it to imx_uart_shutdown(), which is the only user of the DMA > > disabling function. This should not change the driver's behaviour, > > but improves readability. After this change imx_uart_disable_dma() > > does the reverse thing of imx_uart_enable_dma(). > >=20 > > Suggested-by: Nandor Han > > Signed-off-by: Sebastian Reichel > > --- > > drivers/tty/serial/imx.c | 9 ++------- > > 1 file changed, 2 insertions(+), 7 deletions(-) > >=20 > > diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c > > index c2fc6bef7a6f..3ca767b1162a 100644 > > --- a/drivers/tty/serial/imx.c > > +++ b/drivers/tty/serial/imx.c > > @@ -1291,18 +1291,13 @@ static void imx_uart_enable_dma(struct imx_port= *sport) > > =20 > > static void imx_uart_disable_dma(struct imx_port *sport) > > { > > - u32 ucr1, ucr2; > > + u32 ucr1; > > =20 > > /* clear UCR1 */ > > ucr1 =3D imx_uart_readl(sport, UCR1); > > ucr1 &=3D ~(UCR1_RXDMAEN | UCR1_TXDMAEN | UCR1_ATDMAEN); > > imx_uart_writel(sport, ucr1, UCR1); > > =20 > > - /* clear UCR2 */ > > - ucr2 =3D imx_uart_readl(sport, UCR2); > > - ucr2 &=3D ~(UCR2_CTSC | UCR2_CTS | UCR2_ATEN); > > - imx_uart_writel(sport, ucr2, UCR2); > > - > > imx_uart_setup_ufcr(sport, TXTL_DEFAULT, RXTL_DEFAULT); > > =20 > > sport->dma_is_enabled =3D 0; > > @@ -1447,7 +1442,7 @@ static void imx_uart_shutdown(struct uart_port *p= ort) > > =20 > > spin_lock_irqsave(&sport->port.lock, flags); > > ucr2 =3D imx_uart_readl(sport, UCR2); > > - ucr2 &=3D ~(UCR2_TXEN | UCR2_ATEN); > > + ucr2 &=3D ~(UCR2_TXEN | UCR2_CTSC | UCR2_CTS | UCR2_ATEN); > > imx_uart_writel(sport, ucr2, UCR2); > > spin_unlock_irqrestore(&sport->port.lock, flags); >=20 > While this doesn't change behaviour (which is of course good and > intended here) I wonder if changing RTS is right here. >=20 > According to Documentation/serial/driver it is not. Yes, looks like it should be removed completly. I suggest to keep this in two different patches (move UCR2 handling first, then remove RTS handling), so that we end up with simple and comprehensible patches. -- Sebastian --hldlbuxw4kvqlosc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAlrxiZsACgkQ2O7X88g7 +poXtg//egmX9sHgOFQsEbqhN3iiif0GU620EGZbtomR7qc21ZeQIa8EqUtmiXDS ewuMWpAI/Ew0zWGv+BytTXOAtlaWE4P2oSK24jjVudhnoCm/ouBLrJWTKCrnIbYw gYpxmpz9gKKfKseRjESy7b9DPAgS9KywabtS8/bNCcwvkEhiakgbSeUn5Uax+GaE H/d21E6FqU10uLnQqCGfFoezksXG5mrMxlrC9/Wy+mvzfctmBPwmZJ4MLnaeFEdo I6jktQ7kbxDwI9Lw5Tcs2RBNlZuNMh6DhvQrtYcUxjdyis4Z6+rIY761Znat4mwK 7Yz9e/k2kMawuk2ODEXXhEzHDdF0rKk4Tt5wxIDEmv8f7N1g2tQgx0zTzgj3JWT1 tWJy8sBT7Lh4DVxynm8BsFNPCi81yO0rH3hKMjnR19LsDtTIRhfoufXAmEKorbM7 W8acLGCSaNT0ZDEqCzKZGdPMvsq+o/CJ6iZiiUC9K2ZjXAav7m3p5TEbjXbL3GHU sTDxdvK2MGqJG2Vj2dAG2VfuLyyTO/uegp9jT2jxSSvfgndJovp0IgMxAsvoLuyQ 4f4nuMOx491Z1TOPAhszcKfExw73Ak36Zoc5dm73XrfvWRwq1XtK+38igIHvuG6V Z8xThKK+OeIU24ktiD2Fv6wIwsM9J6Y7ciGrjAxhYpEOxAIAIlw= =9R1O -----END PGP SIGNATURE----- --hldlbuxw4kvqlosc--