All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: sashiko-bot@kernel.org
Cc: sashiko-reviews@lists.linux.dev,  conor+dt@kernel.org,
	devicetree@vger.kernel.org,  robh@kernel.org
Subject: Re: [PATCH v2 5/7] clk: Use the generic OF phandle parsing in only one place
Date: Thu, 16 Jul 2026 10:23:04 +0200	[thread overview]
Message-ID: <87v7afcphz.fsf@bootlin.com> (raw)
In-Reply-To: <20260710183649.DE6331F000E9@smtp.kernel.org> (sashiko-bot@kernel.org's message of "Fri, 10 Jul 2026 18:36:49 +0000")

On 10/07/2026 at 18:36:49 GMT, sashiko-bot@kernel.org wrote:

> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> - [High] Switching to `of_parse_clkspec` breaks out-of-bounds indexed
> clock lookups on nodes with `clock-ranges`, causing infinite loops and
> topology corruption.
> - [High] API mismatch between `of_clk_get_parent_name` and
> `of_clk_get_parent_count` regarding `clock-ranges` support.

These two issues are related, I feel like it is best to make sure that
the semantics do not change, which is doable by making sure we do not
loop over the parents when unnecessary, which avoids the possible
out-of-bounds indexing and the API mismatch.

Said otherwise, in of_parse_clkspec() we may check the presence of the
`clocks` property when looking up clks. If the `clocks` property is
there, either we find the clock, or if we get an error it means we are
out of bounds and can return early. If the `clocks` property is not
present, this is when the clock-ranges property may be useful and when
checking the parent is relevant (normal case).

Thanks,
Miquèl

  reply	other threads:[~2026-07-16  8:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10 18:21 [PATCH v2 0/7] clk: Add support for clock nexus Miquel Raynal (Schneider Electric)
2026-07-10 18:21 ` [PATCH v2 1/7] dt-bindings: clock: Introduce nexus nodes Miquel Raynal (Schneider Electric)
2026-07-10 18:29   ` sashiko-bot
2026-07-15 12:38     ` Miquel Raynal
2026-07-10 18:21 ` [PATCH v2 2/7] clk: tests: Add clk_parse_clkspec() Kunit testing Miquel Raynal (Schneider Electric)
2026-07-10 18:31   ` sashiko-bot
2026-07-16  8:15     ` Miquel Raynal
2026-07-10 18:21 ` [PATCH v2 3/7] clk: tests: Add Kunit testing for of_clk_get_parent_name() Miquel Raynal (Schneider Electric)
2026-07-10 18:21 ` [PATCH v2 4/7] clk: Improve a couple of comments Miquel Raynal (Schneider Electric)
2026-07-10 18:22 ` [PATCH v2 5/7] clk: Use the generic OF phandle parsing in only one place Miquel Raynal (Schneider Electric)
2026-07-10 18:36   ` sashiko-bot
2026-07-16  8:23     ` Miquel Raynal [this message]
2026-07-10 18:22 ` [PATCH v2 6/7] clk: Add support for clock nexus dt bindings Miquel Raynal (Schneider Electric)
2026-07-10 18:33   ` sashiko-bot
2026-07-15 12:47     ` Miquel Raynal
2026-07-16 10:55       ` Miquel Raynal
2026-07-10 18:22 ` [PATCH v2 7/7] clk: tests: Add Kunit testing for nexus nodes Miquel Raynal (Schneider Electric)
2026-07-12  8:18 ` [PATCH v2 0/7] clk: Add support for clock nexus Wolfram Sang
2026-07-15 12:55   ` Miquel Raynal
2026-07-15 13:59     ` Wolfram Sang
2026-07-15 14:43       ` Miquel Raynal

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=87v7afcphz.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-bot@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.