From: sashiko-bot@kernel.org
To: "Alexandru Chimac" <alex@chimac.ro>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 3/5] clk: samsung: clk-pll: Add support for pll_1061x
Date: Thu, 16 Jul 2026 17:26:52 +0000 [thread overview]
Message-ID: <20260716172653.1A8B41F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260716-exynos9610-clocks-v2-3-c13ce8ef1861@chimac.ro>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but the fast-path check `samsung_pll46xx_mpk_change()` hardcodes a 9-bit mask for `mdiv`, which incorrectly truncates the 10-bit `mdiv` used by the newly added `pll_1061x` and the existing `pll_1460x`. This can bypass the main multiplier update and leave the PLL running at the wrong frequency.
--
--- Patch [3]: [PATCH v2 3/5] clk: samsung: clk-pll: Add support for pll_1061x ---
commit 22c944c044739f58fab83d8908a877841003ecb0
Author: Alexandru Chimac <alex@chimac.ro>
clk: samsung: clk-pll: Add support for pll_1061x
This patch adds support for the pll_1061x found in the Exynos9610 and
Exynos9810 SoCs. It reuses the logic from pll_1460x, adapting it to use
CON3 instead of CON1.
> diff --git a/drivers/clk/samsung/clk-pll.c b/drivers/clk/samsung/clk-pll.c
> index fdb84bcec9127..5ec9423009c7b 100644
> --- a/drivers/clk/samsung/clk-pll.c
> +++ b/drivers/clk/samsung/clk-pll.c
[ ... ]
> @@ -827,7 +832,10 @@ static int samsung_pll46xx_set_rate(struct clk_hw *hw, unsigned long drate,
> }
>
> con0 = readl_relaxed(pll->con_reg);
> - con1 = readl_relaxed(pll->con_reg + 0x4);
> + if (pll->type == pll_1061x)
> + con1 = readl_relaxed(pll->con_reg + 0xc);
> + else
> + con1 = readl_relaxed(pll->con_reg + 0x4);
>
> if (!(samsung_pll46xx_mpk_change(con0, con1, rate))) {
> /* If only s change, change just s value only*/
> @@ -845,7 +853,7 @@ static int samsung_pll46xx_set_rate(struct clk_hw *hw, unsigned long drate,
[Severity: High]
This isn't a bug introduced by this patch, but does the fast-path check
samsung_pll46xx_mpk_change() incorrectly truncate the 10-bit mdiv for
the newly added pll_1061x and the existing pll_1460x?
Looking at samsung_pll46xx_mpk_change(), it hardcodes a 9-bit mask for
the comparison:
old_mdiv = (pll_con0 >> PLL46XX_MDIV_SHIFT) & PLL46XX_MDIV_MASK;
If the hardware boots with a 10-bit MDIV and the driver requests a new rate
where the lower 9 bits match the current hardware state, old_mdiv == rate->mdiv
will incorrectly evaluate to true.
Will this cause the driver to mistakenly take this SDIV-only fast-path,
skipping the required main multiplier (MDIV) update and leaving the PLL
running at the wrong frequency?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260716-exynos9610-clocks-v2-0-c13ce8ef1861@chimac.ro?part=3
next prev parent reply other threads:[~2026-07-16 17:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 17:14 [PATCH v2 0/5] clk: samsung: Introduce support for Exynos9610 clocks Alexandru Chimac via B4 Relay
2026-07-16 17:14 ` [PATCH v2 1/5] dt-bindings: clock: samsung: Add Exynos9610 CMU bindings Alexandru Chimac via B4 Relay
2026-07-16 17:21 ` sashiko-bot
2026-07-16 17:14 ` [PATCH v2 2/5] dt-bindings: soc: exynos-sysreg: Add Exynos9610 SYSREG bindings Alexandru Chimac via B4 Relay
2026-07-16 17:14 ` [PATCH v2 3/5] clk: samsung: clk-pll: Add support for pll_1061x Alexandru Chimac via B4 Relay
2026-07-16 17:26 ` sashiko-bot [this message]
2026-07-16 17:14 ` [PATCH v2 4/5] clk: samsung: Introduce Exynos9610 clock controller driver Alexandru Chimac via B4 Relay
2026-07-16 17:26 ` sashiko-bot
2026-07-16 17:44 ` Alexandru Chimac
2026-07-16 17:14 ` [PATCH v2 5/5] MAINTAINERS: Add entry for Exynos9610 Alexandru Chimac via B4 Relay
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=20260716172653.1A8B41F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alex@chimac.ro \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox