From: sashiko-bot@kernel.org
To: "Patrick Fischer" <admin@tsv-stahl-riesa.de>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH 2/2] serial: tegra: Fix overflow in tegra_check_rate_in_range()
Date: Sun, 25 Oct 2026 23:08:37 +0000 [thread overview]
Message-ID: <sashiko-outbox-184519@kernel.org> (raw)
In-Reply-To: <20261025-upstream-serial-tegra-overflow-v1-2-267b5b7a79ee@tsv-stahl-riesa.de>
> From: Patrick Fischer <admin@tsv-stahl-riesa.de>
>
> tegra_check_rate_in_range() calculates the deviation of the configured
> from the required clock rate as (configured_rate - required_rate) *
> 10000 in a long, which is only 32 bits wide on 32-bit ARM. This
> overflows as soon as the two rates differ by more than about 214.7 kHz,
> so the check lets through exactly the large deviations it is meant to
> catch.
>
> On the Tegra Note 7 (Tegra114) the Bluetooth UART ran at 45.33 MHz
> instead of 48 MHz at 3 Mbaud (-5.6 %, see the previous patch). The
> check calculated -0.18 % and let it pass, although the limit is 4 %.
>
> Do the multiplication in 64 bits.
>
> Tested on the Tegra Note 7 with a tolerance of -500 for 1 to 4 Mbaud,
> which gives 45.33 MHz at 3 Mbaud: the driver now logs
> "configured baud rate is out of range by -555" and does not apply the
> rate. With the tolerance of 136 (48.00 MHz) it logs nothing.
>
> 64-bit platforms are not affected.
>
> Fixes: d781ec21bae6 ("serial: tegra: report clk rate errors")
> Cc: stable@vger.kernel.org
> Signed-off-by: Patrick Fischer <admin@tsv-stahl-riesa.de>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261025-upstream-serial-tegra-overflow-v1-0-267b5b7a79ee@tsv-stahl-riesa.de?part=2
next prev parent reply other threads:[~2026-10-25 23:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-25 22:50 [PATCH 0/2] serial: tegra: Fix 32-bit overflows in the clock rate adjustment Patrick Fischer via B4 Relay
2026-10-25 22:50 ` Patrick Fischer
2026-10-25 22:50 ` [PATCH 1/2] serial: tegra: Fix overflow in tegra_get_tolerance_rate() Patrick Fischer via B4 Relay
2026-10-25 22:50 ` Patrick Fischer
2026-10-25 23:13 ` sashiko-bot
2026-10-26 8:50 ` Svyatoslav Ryhel
2026-11-26 7:42 ` Mikko Perttunen
2026-10-25 22:50 ` [PATCH 2/2] serial: tegra: Fix overflow in tegra_check_rate_in_range() Patrick Fischer via B4 Relay
2026-10-25 22:50 ` Patrick Fischer
2026-10-25 23:08 ` sashiko-bot [this message]
2026-10-26 8:50 ` Svyatoslav Ryhel
2026-11-26 7:43 ` Mikko Perttunen
2026-11-22 9:42 ` [PATCH 0/2] serial: tegra: Fix 32-bit overflows in the clock rate adjustment Patrick Fischer
2026-11-22 9:46 ` Greg Kroah-Hartman
2026-11-22 10:13 ` Patrick Fischer
2026-11-22 11:03 ` Greg Kroah-Hartman
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=sashiko-outbox-184519@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=admin@tsv-stahl-riesa.de \
--cc=linux-serial@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.