From: Ulrich Hecht <uli@fpond.eu>
To: Geert Uytterhoeven <geert+renesas@glider.be>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>, Ulrich Hecht <uli+renesas@fpond.eu>
Cc: Eugeniu Rosca <erosca@de.adit-jv.com>,
Dirk Behme <dirk.behme@de.bosch.com>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] serial: sh-sci: Fix HSCIF RX sampling point calculation
Date: Mon, 1 Apr 2019 17:05:18 +0200 (CEST) [thread overview]
Message-ID: <805637056.1640115.1554131118962@webmail.strato.com> (raw)
In-Reply-To: <20190401112510.23145-1-geert+renesas@glider.be>
> On April 1, 2019 at 1:25 PM Geert Uytterhoeven <geert+renesas@glider.be> wrote:
>
>
> There are several issues with the formula used for calculating the
> deviation from the intended rate:
> 1. While min_err and last_stop are signed, srr and baud are unsigned.
> Hence the signed values are promoted to unsigned, which will lead
> to a bogus value of deviation if min_err is negative,
> 2. Srr is the register field value, which is one less than the actual
> sampling rate factor,
> 3. The divisions do not use rounding.
>
> Fix this by casting unsigned variables to int, adding one to srr, and
> using a single DIV_ROUND_CLOSEST().
>
> Fixes: 63ba1e00f178a448 ("serial: sh-sci: Support for HSCIF RX sampling point adjustment")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
CU
Uli
next prev parent reply other threads:[~2019-04-01 15:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-01 11:25 [PATCH] serial: sh-sci: Fix HSCIF RX sampling point calculation Geert Uytterhoeven
2019-04-01 12:12 ` Mukesh Ojha
2019-04-01 15:05 ` Ulrich Hecht [this message]
2019-04-04 9:45 ` Eugeniu Rosca
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=805637056.1640115.1554131118962@webmail.strato.com \
--to=uli@fpond.eu \
--cc=dirk.behme@de.bosch.com \
--cc=erosca@de.adit-jv.com \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=uli+renesas@fpond.eu \
/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