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] [day] [month] [year] [list]
Date:	Tue, 11 Aug 2015 09:14:46 +0200 (CEST)
From:	Stefan Wahren <stefan.wahren@...e.com>
To:	Fabio Estevam <festevam@...il.com>,
	Janusz Użycki <j.uzycki@...romaelectronics.com>
Cc:	"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
	Jiri Slaby <jslaby@...e.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Fabio Estevam <fabio.estevam@...escale.com>,
	Juergen Beisert <jbe@...gutronix.de>
Subject: Re: [PATCH RFC] serial: mxs-auart: fix baud rate range

Hi Janusz,

> Janusz Użycki <j.uzycki@...romaelectronics.com> hat am 10. August 2015 um
> 19:01 geschrieben:
>
>
>
>
> W dniu 2015-08-10 o 14:22, Fabio Estevam pisze:
> > On Mon, Aug 10, 2015 at 9:12 AM, Stefan Wahren <stefan.wahren@...e.com>
> > wrote:
> >
> >> /* set baud rate */
> >> - baud = uart_get_baud_rate(u, termios, old, 0, u->uartclk);
> >> + baud_min = u->uartclk * 32 / 0x3fffc0;
> >> + baud_max = u->uartclk * 32 / 0xec;
> >> + baud = uart_get_baud_rate(u, termios, old, baud_min, baud_max);
> > Looks good. It would be nice to replace 0x3fffc0 and 0xec with defines
> > though.
>
> I agree with Fabio.

i will name them AUART_LINECTRL_BAUD_DIV_MIN and AUART_LINECTRL_BAUD_DIV_MAX.

>
> In addition let's look at the example for uartclk = 24MHz:
> baud_max = 3,254,237.29 => will be rounded down to 3,254,237bauds and it
> is OK
> baud_min = 183.1 => will be rounded to 183 bauds. To avoid div=0x400971
> it should be 184
> so DIV_ROUND_UP() macro could be used.

Thanks for pointing out. I will fix that.

Best regards
Stefan

>
> best regards
> Janusz
>
> >
> > Regards,
> >
> > Fabio Estevam
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ