From: Jiri Slaby <jirislaby@kernel.org>
To: Hugo Villeneuve <hugo@hugovil.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jon Ringle <jringle@gridpoint.com>
Cc: Hugo Villeneuve <hvilleneuve@dimonoff.com>,
stable@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org
Subject: Re: [PATCH v2] serial: sc16is7xx: fix bug in sc16is7xx_set_baud() when using prescaler
Date: Thu, 2 May 2024 09:48:27 +0200 [thread overview]
Message-ID: <4f960a0b-85f3-403f-b75a-47fb1b4ea6aa@kernel.org> (raw)
In-Reply-To: <20240430200431.4102923-1-hugo@hugovil.com>
On 30. 04. 24, 22:04, Hugo Villeneuve wrote:
> From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
>
> When using a high speed clock with a low baud rate, the 4x prescaler is
> automatically selected if required. In that case, sc16is7xx_set_baud()
> properly configures the chip registers, but returns an incorrect baud
> rate by not taking into account the prescaler value. This incorrect baud
> rate is then fed to uart_update_timeout().
>
> For example, with an input clock of 80MHz, and a selected baud rate of 50,
> sc16is7xx_set_baud() will return 200 instead of 50.
>
> Fix this by first changing the prescaler variable to hold the selected
> prescaler value instead of the MCR bitfield. Then properly take into
> account the selected prescaler value in the return value computation.
>
> Also add better documentation about the divisor value computation.
>
> Fixes: dfeae619d781 ("serial: sc16is7xx")
> Cc: stable@vger.kernel.org
> Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
>
> ---
>
> Changes for V2:
> - Change prescaler type to "unsigned int" (Jiri S.)
Thanks.
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
--
js
suse labs
prev parent reply other threads:[~2024-05-02 7:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-30 20:04 [PATCH v2] serial: sc16is7xx: fix bug in sc16is7xx_set_baud() when using prescaler Hugo Villeneuve
2024-05-02 7:48 ` Jiri Slaby [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4f960a0b-85f3-403f-b75a-47fb1b4ea6aa@kernel.org \
--to=jirislaby@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hugo@hugovil.com \
--cc=hvilleneuve@dimonoff.com \
--cc=jringle@gridpoint.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox