lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 23 Nov 2022 11:30:13 +0000
From:   Sherry Sun <sherry.sun@....com>
To:     Michael Walle <michael@...le.cc>
CC:     "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "jirislaby@...nel.org" <jirislaby@...nel.org>,
        "jingchang.lu@...escale.com" <jingchang.lu@...escale.com>,
        "tomonori.sakita@...d.co.jp" <tomonori.sakita@...d.co.jp>,
        "atsushi.nemoto@...d.co.jp" <atsushi.nemoto@...d.co.jp>,
        "linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        dl-linux-imx <linux-imx@....com>
Subject: RE: [PATCH V2 2/5] tty: serial: fsl_lpuart: clear UARTCTRL_LOOPS in
 lpuart32_shutdown()



> -----Original Message-----
> From: Michael Walle <michael@...le.cc>
> Sent: 2022年11月23日 19:09
> To: Sherry Sun <sherry.sun@....com>
> Cc: gregkh@...uxfoundation.org; jirislaby@...nel.org;
> jingchang.lu@...escale.com; tomonori.sakita@...d.co.jp;
> atsushi.nemoto@...d.co.jp; linux-serial@...r.kernel.org; linux-
> kernel@...r.kernel.org; dl-linux-imx <linux-imx@....com>
> Subject: Re: [PATCH V2 2/5] tty: serial: fsl_lpuart: clear UARTCTRL_LOOPS in
> lpuart32_shutdown()
> 
> Am 2022-11-23 11:58, schrieb Sherry Sun:
> >> -----Original Message-----
> >> From: Michael Walle <michael@...le.cc>
> >> Sent: 2022年11月23日 18:34
> >> To: Sherry Sun <sherry.sun@....com>
> >> Cc: gregkh@...uxfoundation.org; jirislaby@...nel.org;
> >> jingchang.lu@...escale.com; tomonori.sakita@...d.co.jp;
> >> atsushi.nemoto@...d.co.jp; linux-serial@...r.kernel.org; linux-
> >> kernel@...r.kernel.org; dl-linux-imx <linux-imx@....com>
> >> Subject: Re: [PATCH V2 2/5] tty: serial: fsl_lpuart: clear
> >> UARTCTRL_LOOPS in
> >> lpuart32_shutdown()
> >>
> >> Am 2022-11-10 09:17, schrieb Sherry Sun:
> >> > UARTCTRL_LOOPS bit is set in lpuart32_set_mctrl() for loopback
> >> > mode, but nowhere clear this bit, it should be cleared when closing
> >> > the uart port to avoid the loopback mode been enabled by default
> >> > when reopening the uart.
> >>
> >> It's cleared in set_mctrl(). What is the expectation from the serial
> >> core here?
> >>
> >
> > Hi Michael,
> >
> > If we call .set_mctrl(TIOCM_LOOP), the UARTCTRL_LOOPS will be set.
> > Then when we call .shutdown(), serial core won't call .set_mctrl() to
> > clear it, so the UARTCTRL_LOOPS need to be cleared here.
> > Per my understanding, .shutdown() should clean up all the uart flags,
> > as the transmitter and receiver will been disabled, we will
> > re-configure all the settings needed when re-open the port.
> 
> Two things,
> (1) should the loopback be cleared on a newly opened serial device?
> (2) as mentioned in my other reply, this can also be handled in
>      the startup. Eg. the startup can clear the loopback flag.
>      (together with possible hardware events).
> 
> I'm not that deep into the serial core, thus my question about the
> expectations from the serial core. I guess the answer to
> (1) is yes, but better to ask.
> 

Hi Michael,

For the (1), I have checked the serial core, seems the answer is no, . startup() won't clean the status, only when the uart device is probed, lpuart will do the global reset to all the registers instead of .startup(). So I think the uart running status cleared in .shutdown() is reasonable.

Best Regards
Sherry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ