From: Chen-Yu Tsai <wens@kernel.org>
To: Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>,
Romain TISSERAND <romain.tisserand@gmail.com>
Cc: Stephen Boyd <sboyd@kernel.org>,
Brian Masney <bmasney+clk@redhat.com>,
Jerome Brunet <jbrunet+clk@baylibre.com>,
Maxime Ripard <mripard@kernel.org>,
Frank Oltmanns <frank@oltmanns.dev>,
linux-clk@vger.kernel.org, linux-sunxi@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, sashiko-reviews@lists.linux.dev
Subject: Re: [PATCH] clk: sunxi-ng: nkm: avoid 32-bit overflow in rate calculations
Date: Sun, 15 Nov 2026 16:33:10 +0800 [thread overview]
Message-ID: <179473159063.3023207.9708704432594076650.b4-ty@kernel.org> (raw)
In-Reply-To: <20261101203336.1360239-1-romain.tisserand@gmail.com>
On Sun, 01 Nov 2026 21:33:36 +0100, Romain TISSERAND wrote:
> The N-K-M rate code computes parent * n * k / m in an unsigned long,
> which wraps on 32-bit ARM as soon as parent * n * k passes 4.29 GHz.
>
> On the A33, pll-mipi (parent pll-video at 297 MHz) with N = 14, K = 2,
> M = 14 runs at 594 MHz, but 297 MHz * 14 * 2 wraps around to
> 4021032704 and the code computes 287.2 MHz. ccu_nkm_find_best() then
> picks these factors for a 288 MHz request, and clk_get_rate() reports
> 287.2 MHz while the PLL runs at twice that. On a PocketGo S30 (A33,
> ILI9488 panel on one MIPI-DSI lane) the lane ended up at about
> 594 Mbit/s instead of 288 and the picture broke up.
>
> [...]
Applied to sunxi/clk-for-7.5 in sunxi, thanks!
[1/1] clk: sunxi-ng: nkm: avoid 32-bit overflow in rate calculations
https://git.kernel.org/sunxi/linux/c/e9d9dae0d248
Best regards,
--
Chen-Yu Tsai <wens@kernel.org>
prev parent reply other threads:[~2026-11-15 8:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-01 20:33 Romain TISSERAND
2026-11-15 1:20 ` Romain TISSERAND
2026-11-15 7:03 ` Jernej Škrabec
2026-11-15 8:33 ` Chen-Yu Tsai [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=179473159063.3023207.9708704432594076650.b4-ty@kernel.org \
--to=wens@kernel.org \
--cc=bmasney+clk@redhat.com \
--cc=frank@oltmanns.dev \
--cc=jbrunet+clk@baylibre.com \
--cc=jernej.skrabec@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=mripard@kernel.org \
--cc=romain.tisserand@gmail.com \
--cc=samuel@sholland.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sboyd@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
all inboxes | Powered by JetHome®