From: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>,
linux-serial@vger.kernel.org,
Fabio Estevam <fabio.estevam@nxp.com>,
Shawn Guo <shawnguo@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] serial: imx: cleanup imx_uart_disable_dma()
Date: Tue, 8 May 2018 13:27:26 +0200 [thread overview]
Message-ID: <20180508112726.nyxrebcuwwdq5npy@earth.universe> (raw)
In-Reply-To: <20180508064047.v7wz7b4t5ta55hv7@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 2385 bytes --]
Hi,
On Tue, May 08, 2018 at 08:40:47AM +0200, Uwe Kleine-König 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().
> >
> > Suggested-by: Nandor Han <nandor.han@ge.com>
> > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
> > ---
> > drivers/tty/serial/imx.c | 9 ++-------
> > 1 file changed, 2 insertions(+), 7 deletions(-)
> >
> > 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)
> >
> > static void imx_uart_disable_dma(struct imx_port *sport)
> > {
> > - u32 ucr1, ucr2;
> > + u32 ucr1;
> >
> > /* clear UCR1 */
> > ucr1 = imx_uart_readl(sport, UCR1);
> > ucr1 &= ~(UCR1_RXDMAEN | UCR1_TXDMAEN | UCR1_ATDMAEN);
> > imx_uart_writel(sport, ucr1, UCR1);
> >
> > - /* clear UCR2 */
> > - ucr2 = imx_uart_readl(sport, UCR2);
> > - ucr2 &= ~(UCR2_CTSC | UCR2_CTS | UCR2_ATEN);
> > - imx_uart_writel(sport, ucr2, UCR2);
> > -
> > imx_uart_setup_ufcr(sport, TXTL_DEFAULT, RXTL_DEFAULT);
> >
> > sport->dma_is_enabled = 0;
> > @@ -1447,7 +1442,7 @@ static void imx_uart_shutdown(struct uart_port *port)
> >
> > spin_lock_irqsave(&sport->port.lock, flags);
> > ucr2 = imx_uart_readl(sport, UCR2);
> > - ucr2 &= ~(UCR2_TXEN | UCR2_ATEN);
> > + ucr2 &= ~(UCR2_TXEN | UCR2_CTSC | UCR2_CTS | UCR2_ATEN);
> > imx_uart_writel(sport, ucr2, UCR2);
> > spin_unlock_irqrestore(&sport->port.lock, flags);
>
> While this doesn't change behaviour (which is of course good and
> intended here) I wonder if changing RTS is right here.
>
> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-05-08 11:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-07 21:36 [PATCH 0/2] serial: imx: cleanup shutdown Sebastian Reichel
2018-05-07 21:36 ` [PATCH 1/2] serial: imx: cleanup imx_uart_disable_dma() Sebastian Reichel
2018-05-08 6:40 ` Uwe Kleine-König
2018-05-08 11:27 ` Sebastian Reichel [this message]
2018-05-07 21:36 ` [PATCH 2/2] serial: imx: dma_unmap_sg buffers on shutdown Sebastian Reichel
2018-05-08 6:43 ` Uwe Kleine-König
2018-05-08 13:40 ` Sebastian Reichel
2018-05-08 18:46 ` Uwe Kleine-König
2018-05-09 10:20 ` Sebastian Reichel
2018-05-09 10:42 ` Uwe Kleine-König
2018-05-09 11:28 ` Sebastian Reichel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180508112726.nyxrebcuwwdq5npy@earth.universe \
--to=sebastian.reichel@collabora.co.uk \
--cc=fabio.estevam@nxp.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=shawnguo@kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).