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:   Mon, 22 Nov 2021 21:27:11 -0800
From:   Jay Dolan <jay.dolan@...esio.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org
Cc:     Jiri Slaby <jirislaby@...nel.org>
Subject: Re: [PATCH v2 3/3] serial: 8250_pericom: Use serial_dl_write()
 instead of open coded



On 11/22/21 5:35 AM, Andy Shevchenko wrote:
> It's better to stick with standard API to write and read DL value
> when the hardware is compatible with it. In case any quirks are
> needed it may be easily added in one place rather than modifying
> code here and there.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>   drivers/tty/serial/8250/8250_pericom.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_pericom.c b/drivers/tty/serial/8250/8250_pericom.c
> index f0d026325f17..025b055363c3 100644
> --- a/drivers/tty/serial/8250/8250_pericom.c
> +++ b/drivers/tty/serial/8250/8250_pericom.c
> @@ -70,11 +70,11 @@ static void pericom_do_set_divisor(struct uart_port *port, unsigned int baud,
>   		/* Update delta due to possible divisor change */
>   		delta = maxrate / divisor - baud;
>   		if (abs(delta) < baud / 50) {
> +			struct uart_8250_port *up = up_to_u8250p(port);
>   			int lcr = serial_port_in(port, UART_LCR);
>   
>   			serial_port_out(port, UART_LCR, lcr | 0x80);
> -			serial_port_out(port, UART_DLL, divisor & 0xff);
> -			serial_port_out(port, UART_DLM, (divisor >> 8) & 0xff);
> +			serial_dl_write(up, divisor);
>   			serial_port_out(port, 2, 16 - scr);
>   			serial_port_out(port, UART_LCR, lcr);
>   			return;
> 

I tested this change with a few baud rates in my current tree, and I saw 
the correct speeds coming out on the scope.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ