Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Chancel Liu" <chancel.liu@nxp.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org,
	Frank.Li@kernel.org, imx@lists.linux.dev, krzk+dt@kernel.org
Subject: Re: [PATCH 1/5] clk: Add support for clock nexus dt bindings
Date: Sat, 09 May 2026 03:14:18 +0000	[thread overview]
Message-ID: <20260509031419.3828CC2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260509024846.2094049-2-chancel.liu@nxp.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Incomplete clock nexus node implementation breaks assigned clocks and parent resolution.
- [Low] Stale comment referencing replaced function in `of_parse_clkspec()`.
--

commit bfd03486778cd0e1335a28b465c6294bbcca9284
Author: Chancel Liu <chancel.liu@nxp.com>

clk: Add support for clock nexus dt bindings

This commit introduces support for clock nexus nodes by updating
of_parse_clkspec() to use of_parse_phandle_with_args_map(). This allows
remapping phandles and their arguments through nexus nodes to find the
actual clock provider.

> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 048adfa86a5d0..4240f059bec2b 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -5199,15 +5199,15 @@ static int of_parse_clkspec(const struct device_node *np, int index,
>  	/* Walk up the tree of devices looking for a clock property that matches */
>  	while (np) {
>  		/*
>  		 * For named clocks, first look up the name in the
>  		 * "clock-names" property.  If it cannot be found, then index
>  		 * will be an error code and of_parse_phandle_with_args() will
>  		 * return -EINVAL.
>  		 */

This isn't a bug, but should the comment here be updated to refer to the new
of_parse_phandle_with_args_map() function variant?

>  		if (name)
>  			index = of_property_match_string(np, "clock-names", name);
> -		ret = of_parse_phandle_with_args(np, "clocks", "#clock-cells",
> -						 index, out_args);
> +		ret = of_parse_phandle_with_args_map(np, "clocks", "clock",
> +						     index, out_args);

If a device tree utilizes nexus nodes for assigned-clocks or
assigned-clock-parents, how do the core clock paths handle parent
resolution?

Looking at __set_clk_parents() and __set_clk_rates() in
drivers/clk/clk-conf.c, and of_clk_get_parent_name() in drivers/clk/clk.c,
these sites still appear to use the unmapped of_parse_phandle_with_args()
function.

When using nexus nodes for these properties, won't the specifier resolve to
the nexus node itself rather than the mapped clock provider?

Since the nexus node is not registered as a clock provider, it looks like
of_clk_get_from_provider() will return -EPROBE_DEFER, which could cause the
consumer device to silently defer probing forever.

Are there plans to update these core paths to use
of_parse_phandle_with_args_map() to fully support clock nexus nodes
system-wide without causing regressions for valid configurations?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260509024846.2094049-1-chancel.liu@nxp.com?part=1

  reply	other threads:[~2026-05-09  3:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-09  2:48 [PATCH 0/5] arm64: dts: freescale: Add IMX-AUD-IO daughter board support Chancel Liu
2026-05-09  2:48 ` [PATCH 1/5] clk: Add support for clock nexus dt bindings Chancel Liu
2026-05-09  3:14   ` sashiko-bot [this message]
2026-05-09  2:48 ` [PATCH 2/5] dt-bindings: connector: Add fsl,io-connector binding Chancel Liu
2026-05-09  3:18   ` sashiko-bot
2026-05-09  2:48 ` [PATCH 3/5] arm64: dts: freescale: imx95-19x19-evk: Add IMX-AUD-IO board support Chancel Liu
2026-05-09  2:48 ` [PATCH 4/5] arm64: dts: freescale: imx952-evk: " Chancel Liu
2026-05-09  2:48 ` [PATCH 5/5] arm64: dts: freescale: Add common DTS overlay for IMX-AUD-IO daughter board Chancel Liu

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=20260509031419.3828CC2BCB0@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=chancel.liu@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=krzk+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko@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