From: sashiko-bot@kernel.org
To: "Luo Jie" <jie.luo@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 04/12] clk: qcom: ipq-cmn-pll: Add NSS clock support
Date: Fri, 24 Jul 2026 15:15:02 +0000 [thread overview]
Message-ID: <20260724151502.E83701F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260724-qcom_ipq5210_cmnpll-v1-4-a8b8679d215f@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] clk_nss_ppe_determine_rate violates the clock framework API contract when req->rate is 0.
- [Medium] Modifying the NSS clock divider resets the entire CMN PLL block, potentially disrupting other shared fixed-rate clocks.
--
--- Patch [4]: [PATCH 04/12] clk: qcom: ipq-cmn-pll: Add NSS clock support ---
commit b809b8bd5941993b064f7e68f395a77c3ea61452
Author: Luo Jie <jie.luo@oss.qualcomm.com>
clk: qcom: ipq-cmn-pll: Add NSS clock support
The NSS (network subsystem) clock is derived from the CMN PLL output
divided by 2 and then further divided by a configurable 6-bit divider
with a valid range of 8-63.
> diff --git a/drivers/clk/qcom/ipq-cmn-pll.c b/drivers/clk/qcom/ipq-cmn-pll.c
> index aa319d577871a..3df326c22fbac 100644
> --- a/drivers/clk/qcom/ipq-cmn-pll.c
> +++ b/drivers/clk/qcom/ipq-cmn-pll.c
[ ... ]
> @@ -364,11 +369,105 @@ static struct clk_hw *ipq_cmn_pll_clk_hw_register(struct platform_device *pdev)
> return &cmn_pll->hw;
> }
>
> +/*
> + * NSS (Network Subsystem) clock operations.
> + * The NSS clock is derived from CMN PLL rate / 2, then divided by
> + * a configurable 6-bit divider (8-63).
> + */
[ ... ]
> +static int clk_nss_ppe_determine_rate(struct clk_hw *hw,
> + struct clk_rate_request *req)
> +{
> + unsigned long div;
> +
> + if (WARN_ON_ONCE(!req->rate))
> + return 0;
[Severity: Medium]
When req->rate is 0, this returns 0 (success) without updating req->rate to a
valid boundary or returning an error code like -EINVAL.
Can this regression violate the clock framework API contract by falsely
indicating to consumers that 0 Hz is a supported configuration?
> +
> + div = DIV_ROUND_CLOSEST_ULL((u64)req->best_parent_rate, 2ULL * req->rate);
> + div = clamp_t(unsigned long, div, CMN_PLL_NSS_PPE_DIV_MIN,
> + CMN_PLL_NSS_PPE_DIV_MAX);
> +
> + req->rate = DIV_ROUND_CLOSEST_ULL((u64)req->best_parent_rate, 2ULL * div);
> + return 0;
> +}
> +
> +static int clk_nss_set_rate(struct clk_hw *hw, unsigned long rate,
> + unsigned long parent_rate)
> +{
[ ... ]
> + ret = regmap_update_bits(nss_clk->regmap, CMN_PLL_NSS_PPE_FREQ_CTRL,
> + CMN_PLL_NSS_CLK_SEL,
> + FIELD_PREP(CMN_PLL_NSS_CLK_SEL, div));
> + if (ret)
> + return ret;
> +
> + return clk_cmn_pll_ana_soft_reset(nss_clk->regmap);
[Severity: Medium]
Does updating the leaf NSS clock divider strictly require a hardware-level
analog reset of the parent PLL block?
Calling clk_cmn_pll_ana_soft_reset() drops the global PLL lock by toggling
CMN_ANA_EN_SW_RSTN:
clk_cmn_pll_ana_soft_reset() {
...
ret = regmap_clear_bits(regmap, CMN_PLL_POWER_ON_AND_RESET,
CMN_ANA_EN_SW_RSTN);
...
}
Will this regression interrupt other derived clocks (e.g., PCIe, WLAN,
SYS_CLK) and cause link drops or system instability whenever the NSS divider
is dynamically updated?
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260724-qcom_ipq5210_cmnpll-v1-0-a8b8679d215f@oss.qualcomm.com?part=4
next prev parent reply other threads:[~2026-07-24 15:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 15:00 [PATCH 00/12] clk: qcom: ipq-cmn-pll: Add IPQ5210 CMN PLL support Luo Jie
2026-07-24 15:00 ` [PATCH 01/12] clk: qcom: ipq-cmn-pll: Use devm_clk_hw_register_fixed_rate_parent_data Luo Jie
2026-07-24 15:50 ` Konrad Dybcio
2026-07-24 15:00 ` [PATCH 02/12] dt-bindings: clock: qcom: Add CMN PLL support for IPQ5210 SoC Luo Jie
2026-07-24 15:00 ` [PATCH 03/12] clk: qcom: ipq-cmn-pll: Add analog soft-reset helper Luo Jie
2026-07-24 15:00 ` [PATCH 04/12] clk: qcom: ipq-cmn-pll: Add NSS clock support Luo Jie
2026-07-24 15:15 ` sashiko-bot [this message]
2026-07-24 15:00 ` [PATCH 05/12] clk: qcom: ipq-cmn-pll: Add PPE " Luo Jie
2026-07-24 15:19 ` sashiko-bot
2026-07-24 15:00 ` [PATCH 06/12] clk: qcom: ipq-cmn-pll: Add PON reference " Luo Jie
2026-07-24 15:11 ` sashiko-bot
2026-07-24 15:00 ` [PATCH 07/12] clk: qcom: ipq-cmn-pll: Add EPHY-RAW " Luo Jie
2026-07-24 15:00 ` [PATCH 08/12] clk: composite: Export devm_clk_hw_register_composite_pdata Luo Jie
2026-07-24 16:01 ` Brian Masney
2026-07-24 15:00 ` [PATCH 09/12] clk: qcom: ipq-cmn-pll: Add clock gate support for fixed clocks Luo Jie
2026-07-24 15:00 ` [PATCH 10/12] clk: qcom: ipq-cmn-pll: Add all output clocks for IPQ5210 Luo Jie
2026-07-24 15:00 ` [PATCH 11/12] arm64: dts: qcom: ipq5210: Add CMN PLL device node Luo Jie
2026-07-24 15:00 ` [PATCH 12/12] arm64: dts: qcom: Update IPQ5210 xo_board to use fixed factor clock Luo Jie
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=20260724151502.E83701F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jie.luo@oss.qualcomm.com \
--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