RE: [PATCH] tty: serial: imx: clear RTSD status before suspend

From: Sherry Sun
Date: Tue Nov 23 2021 - 03:41:26 EST


Hi Uwe,

> -----Original Message-----
> From: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
> Sent: 2021年11月23日 15:42
> To: Sherry Sun <sherry.sun@xxxxxxx>
> Cc: gregkh@xxxxxxxxxxxxxxxxxxx; jirislaby@xxxxxxxxxx; linux-
> serial@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; dl-linux-imx <linux-
> imx@xxxxxxx>
> Subject: Re: [PATCH] tty: serial: imx: clear RTSD status before suspend
>
> On Tue, Nov 23, 2021 at 03:03:49PM +0800, Sherry Sun wrote:
> > From: Fugang Duan <fugang.duan@xxxxxxx>
> >
> > Clear RTSD status before suspend due to the port also use RTS pin as
> > wakeup source, need to clear the flag first.
>
> I'd write:
>
> Clear RTSD status before enabling the irq event for RTSD.

Thanks for the suggestion, I will reorganize the commit message and send V2.

>
> That this happens in the context of suspend isn't that important.

Sorry I didn't get the point here, can you please explain more?
Per my understanding, the wakeup source interrupt is handled in the suspend context, so clear the flag in the suspend context is also necessary.

Best regards
Sherry

>
> > Signed-off-by: Fugang Duan <fugang.duan@xxxxxxx>
> > Signed-off-by: Sherry Sun <sherry.sun@xxxxxxx>
> > ---
> > drivers/tty/serial/imx.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index
> > 90f82e6c54e4..fb75e3e0d828 100644
> > --- a/drivers/tty/serial/imx.c
> > +++ b/drivers/tty/serial/imx.c
> > @@ -2482,10 +2482,12 @@ static void imx_uart_enable_wakeup(struct
> > imx_port *sport, bool on)
> >
> > if (sport->have_rtscts) {
> > u32 ucr1 = imx_uart_readl(sport, UCR1);
> > - if (on)
> > + if (on) {
> > + imx_uart_writel(sport, USR1_RTSD, USR1);
> > ucr1 |= UCR1_RTSDEN;
> > - else
> > + } else {
> > ucr1 &= ~UCR1_RTSDEN;
> > + }
> > imx_uart_writel(sport, ucr1, UCR1);
> > }
>
> The change looks fine.
>
> Best regards
> Uwe
>
> --
> Pengutronix e.K. | Uwe Kleine-König |
> Industrial Linux Solutions | https://www.pengutronix.de/ |