Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yu-Chun Lin" <eleanor.lin@realtek.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v8 06/10] clk: realtek: Add support for mux clock
Date: Wed, 10 Jun 2026 08:19:32 +0000	[thread overview]
Message-ID: <20260610081933.22E271F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260610080824.255063-7-eleanor.lin@realtek.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] clk_regmap_mux_get_parent() returns 0 instead of an error indicator when regmap_read() fails, silently masking the I/O error and confusing the Common Clock Framework.
--

commit 6f252a1d2352da3ab0338149dff431cfd1082f04
Author: Cheng-Yu Lee <cylee12@realtek.com>

clk: realtek: Add support for mux clock

Add a simple regmap-based clk_ops implementation for Realtek mux clocks.
The implementation supports parent selection and rate determination through
regmap-backed register access.

> diff --git a/drivers/clk/realtek/clk-regmap-mux.c b/drivers/clk/realtek/clk-regmap-mux.c
> new file mode 100644
> index 0000000000000..8bb66a9e244a1
> --- /dev/null
> +++ b/drivers/clk/realtek/clk-regmap-mux.c

[ ... ]

> +static u8 clk_regmap_mux_get_parent(struct clk_hw *hw)
> +{
> +	struct clk_regmap_mux *clkm = to_clk_regmap_mux(hw);
> +	int num_parents = clk_hw_get_num_parents(hw);
> +	u32 val;
> +	int ret;
> +
> +	ret = regmap_read(clkm->clkr.regmap, clkm->mux_ofs, &val);
> +	if (ret)
> +		return 0;

[Severity: High]
When regmap_read() fails here, it returns 0. Since 0 is a valid parent
index in the Common Clock Framework, will this mask the I/O error and falsely
report that parent 0 is active?

If the hardware was actually using a different parent, this could lead the
CCF to incorrectly assume the actual parent has no active children and
potentially gate it during clk_disable_unused(). Would it be safer to
return an out-of-bounds value like 0xff (which is used later in this
function) or an error code when the read fails, to prevent the CCF from
making incorrect assumptions about the hardware state?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260610080824.255063-1-eleanor.lin@realtek.com?part=6

  reply	other threads:[~2026-06-10  8:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-10  8:08 [PATCH v8 00/10] clk: realtek: Add RTD1625 clock support Yu-Chun Lin
2026-06-10  8:08 ` [PATCH v8 01/10] dt-bindings: clock: Add Realtek RTD1625 Clock & Reset Controller Yu-Chun Lin
2026-06-10  8:08 ` [PATCH v8 02/10] reset: Add Realtek basic reset support Yu-Chun Lin
2026-06-10  8:18   ` sashiko-bot
2026-06-10  8:08 ` [PATCH v8 03/10] clk: realtek: Introduce a common probe() Yu-Chun Lin
2026-06-10  8:08 ` [PATCH v8 04/10] clk: realtek: Add support for phase locked loops (PLLs) Yu-Chun Lin
2026-06-10  8:18   ` sashiko-bot
2026-06-10  8:08 ` [PATCH v8 05/10] clk: realtek: Add support for gate clock Yu-Chun Lin
2026-06-10  8:08 ` [PATCH v8 06/10] clk: realtek: Add support for mux clock Yu-Chun Lin
2026-06-10  8:19   ` sashiko-bot [this message]
2026-06-10  8:08 ` [PATCH v8 07/10] clk: realtek: Add support for MMC-tuned PLL clocks Yu-Chun Lin
2026-06-10  8:19   ` sashiko-bot
2026-06-10  8:08 ` [PATCH v8 08/10] clk: realtek: Add RTD1625-CRT clock controller driver Yu-Chun Lin
2026-06-10  8:08 ` [PATCH v8 09/10] clk: realtek: Add RTD1625-ISO " Yu-Chun Lin
2026-06-10  8:08 ` [PATCH v8 10/10] arm64: dts: realtek: Add clock support for RTD1625 Yu-Chun Lin

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=20260610081933.22E271F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=eleanor.lin@realtek.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