Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Stanislav Aleksandrov" <lightofmysoul@gmail.com>
Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 4/5] clk: qcom: common: Register clk_ref clocks from qcom_cc_desc
Date: Mon, 09 Nov 2026 00:42:26 +0000	[thread overview]
Message-ID: <sashiko-outbox-204243@kernel.org> (raw)
In-Reply-To: <20261109-halliday-clk-v1-4-20c3ba8be0bd@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] clk: qcom: qcom_cc_clk_hw_get() returns -EINVAL for protected
  clk_ref
--

commit fa96d79cffd1dd43d975e203514d31dbe847897b
Author: Stanislav Aleksandrov <lightofmysoul@gmail.com>

clk: qcom: common: Register clk_ref clocks from qcom_cc_desc

This commit adds support for registering clk_ref clocks from a
qcom_cc_desc descriptor alongside standard regmap clocks in
qcom_cc_really_probe().

> diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
> index 08fd62ac780d3..c767fa3d02079 100644
> --- a/drivers/clk/qcom/common.c
> +++ b/drivers/clk/qcom/common.c
[ ... ]
> @@ -247,6 +250,9 @@ static struct clk_hw *qcom_cc_clk_hw_get(struct of_phandle_args *clkspec,
>  	struct qcom_cc *cc = data;
>  	unsigned int idx = clkspec->args[0];
>  
> +	if (idx < cc->num_clk_refs && cc->clk_refs[idx])
> +		return &cc->clk_refs[idx]->hw;
> +
>  	if (idx >= cc->num_rclks) {
>  		pr_err("%s: invalid index %u\n", __func__, idx);
>  		return ERR_PTR(-EINVAL);

[Severity: Medium]
Does qcom_cc_clk_hw_get() return ERR_PTR(-EINVAL) instead of NULL for a
protected clk_ref when idx >= cc->num_rclks?

qcom_cc_register_clk_refs() skips entries listed in protected-clocks,
leaving cc->clk_refs[idx] NULL so consumers receive a no-op NULL clock.
However, when cc->num_clk_refs > cc->num_rclks and a protected clk_ref
has idx >= cc->num_rclks, lookup falls through to the idx >= cc->num_rclks
check, logs an invalid index error, and fails the consumer's clk_get()
with -EINVAL.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261109-halliday-clk-v1-0-20c3ba8be0bd@gmail.com?part=4

  reply	other threads:[~2026-11-09  0:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09  0:29 [PATCH 0/5] Add RPMh and global clock controller support for Qualcomm Halliday (SXR2250P) Stanislav Aleksandrov
2026-11-09  0:29 ` [PATCH 1/5] dt-bindings: clock: qcom: document the Halliday RPMh Clock Controller Stanislav Aleksandrov
2026-11-09  0:29 ` [PATCH 2/5] clk: qcom: rpmh: Add support for RPMh clocks on Halliday Stanislav Aleksandrov
2026-11-09  8:54   ` Abel Vesa
2026-11-09  0:29 ` [PATCH 3/5] dt-bindings: clock: qcom: document the Halliday Global Clock Controller Stanislav Aleksandrov
2026-11-09  0:29 ` [PATCH 4/5] clk: qcom: common: Register clk_ref clocks from qcom_cc_desc Stanislav Aleksandrov
2026-11-09  0:42   ` sashiko-bot [this message]
2026-11-09  0:29 ` [PATCH 5/5] clk: qcom: Add support for Global clock controller on Halliday Stanislav Aleksandrov
2026-11-09  0:40   ` sashiko-bot

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-204243@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lightofmysoul@gmail.com \
    --cc=linux-clk@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