From: Frank Li <Frank.li@oss.nxp.com>
To: "Miquel Raynal (Schneider Electric)" <miquel.raynal@bootlin.com>
Cc: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Brian Masney <bmasney@redhat.com>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Brendan Higgins <brendan.higgins@linux.dev>,
David Gow <david@davidgow.net>, Rae Moar <raemoar63@gmail.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Pascal EBERHARD <pascal.eberhard@se.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
kunit-dev@googlegroups.com
Subject: Re: [PATCH v5 5/7] clk: Use the generic OF phandle parsing in only one place
Date: Fri, 7 Aug 2026 11:26:41 -0500 [thread overview]
Message-ID: <anYHQWEExCgBHtbo@SMW015318> (raw)
In-Reply-To: <20260807-schneider-v7-2-rc1-eip201-upstream-v5-5-8785f9531cf0@bootlin.com>
On Fri, Aug 07, 2026 at 05:24:06PM +0200, Miquel Raynal (Schneider Electric) wrote:
> Ideally, there should be one single entry in the OF world. This way, the
> DT parsing logic is always identical. At this stage, we call
> of_parse_phandle_with_args() in:
> - of_parse_clkspec()
> - of_clk_get_parent_name()
> which kinds of defeats the above statement. Furthermore, when this call
> is done from of_clk_get_parent_name(), we fail to parse the
> 'clock-ranges' property.
>
> Make sure DT world is entered only once by calling of_parse_clkspec()
> from of_clk_get_parent_name(). Doing so implies that we do not try the
> "clock-ranges" path if we already found a "clocks" property.
>
> Suggested-by: Stephen Boyd <sboyd@kernel.org>
> Fixes: 4472287a3b2f5 ("clk: Introduce of_clk_get_hw_from_clkspec()")
> Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
> Reviewed-by: Brian Masney <bmasney@redhat.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/clk/clk.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 7d63d81ebc09..45f5d7a4ccc1 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -5219,6 +5219,8 @@ static int of_parse_clkspec(const struct device_node *np, int index,
> * has a "clock-ranges" property, then we can try one of its
> * clocks.
> */
> + if (of_property_present(np, "clocks"))
> + break;
> np = np->parent;
> if (np && !of_property_present(np, "clock-ranges"))
> break;
> @@ -5364,8 +5366,7 @@ const char *of_clk_get_parent_name(const struct device_node *np, int index)
> int count;
> struct clk *clk;
>
> - rc = of_parse_phandle_with_args(np, "clocks", "#clock-cells", index,
> - &clkspec);
> + rc = of_parse_clkspec(np, index, NULL, &clkspec);
> if (rc)
> return NULL;
>
>
> --
> 2.54.0
>
next prev parent reply other threads:[~2026-08-07 16:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 15:24 [PATCH v5 0/7] clk: Add support for clock nexus Miquel Raynal (Schneider Electric)
2026-08-07 15:24 ` [PATCH v5 1/7] dt-bindings: clock: Introduce nexus nodes Miquel Raynal (Schneider Electric)
2026-08-07 15:33 ` sashiko-bot
2026-08-07 15:24 ` [PATCH v5 2/7] clk: tests: Add clk_parse_clkspec() Kunit testing Miquel Raynal (Schneider Electric)
2026-08-07 15:24 ` [PATCH v5 3/7] clk: tests: Add Kunit testing for of_clk_get_parent_name() Miquel Raynal (Schneider Electric)
2026-08-07 15:24 ` [PATCH v5 4/7] clk: Improve a couple of comments Miquel Raynal (Schneider Electric)
2026-08-07 16:23 ` Frank Li
2026-08-07 15:24 ` [PATCH v5 5/7] clk: Use the generic OF phandle parsing in only one place Miquel Raynal (Schneider Electric)
2026-08-07 15:41 ` sashiko-bot
2026-08-07 16:26 ` Frank Li [this message]
2026-08-07 15:24 ` [PATCH v5 6/7] clk: Add support for clock nexus dt bindings Miquel Raynal (Schneider Electric)
2026-08-07 15:35 ` sashiko-bot
2026-08-07 15:24 ` [PATCH v5 7/7] clk: tests: Add Kunit testing for nexus nodes Miquel Raynal (Schneider Electric)
2026-08-07 15:33 ` 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=anYHQWEExCgBHtbo@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=bmasney@redhat.com \
--cc=brendan.higgins@linux.dev \
--cc=conor+dt@kernel.org \
--cc=david@davidgow.net \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kunit-dev@googlegroups.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=mturquette@baylibre.com \
--cc=pascal.eberhard@se.com \
--cc=raemoar63@gmail.com \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=wsa+renesas@sang-engineering.com \
/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