[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160926061750.4jjgpbttdesdyrae@pengutronix.de>
Date: Mon, 26 Sep 2016 08:17:50 +0200
From: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
To: Nicolas Ferre <nicolas.ferre@...el.com>
Cc: aystarik@...il.com,
Ludovic Desroches <ludovic.desroches@...el.com>,
Boris BREZILLON <boris.brezillon@...e-electrons.com>,
richard.genoud@...il.com, linux-serial@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org,
Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
Cyrille Pitchen <cyrille.pitchen@...el.com>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] tty/serial: atmel: fix fractional baud rate computation
Hello,
On Wed, Sep 21, 2016 at 12:44:14PM +0200, Nicolas Ferre wrote:
> From: Alexey Starikovskiy <aystarik@...il.com>
>
> The problem with previous code was it rounded values in wrong
> place and produced wrong baud rate in some cases.
>
> Signed-off-by: Alexey Starikovskiy <aystarik@...il.com>
> [nicolas.ferre@...el.com: port to newer kernel and add commit log]
> Signed-off-by: Nicolas Ferre <nicolas.ferre@...el.com>
I first thought this patch results in not always picking the optimal
divider in some cases. But given the right error function (i.e.
error(r) = abs(1/r_target - 1/r_actual) which minimizes the error in the
time domain and so guarantees the maximal count of matched samples) it
can be proved to result in the right values (assuming no overflow etc.).
As writing formulas in email is cumbersome, see the attachment for a
prove.
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Download attachment "baudrate.pdf" of type "application/pdf" (69704 bytes)
Powered by blists - more mailing lists