Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Miquel Raynal" <miquel.raynal@bootlin.com>
Cc: robh@kernel.org, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v5 9/9] arm64: dts: nuvoton: ma35d1: Add LXT crystal and correct HXT name
Date: Tue, 29 Sep 2026 15:01:20 +0000	[thread overview]
Message-ID: <20260929150121.739D91F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260929-perso-ma35d1-upstream-clk-v5-9-68533e935ee4@bootlin.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] clk: nuvoton: DT change panics older kernels via name collision
--

commit bbea265e667383111c175f21144622719e32c1cb
Author: Miquel Raynal <miquel.raynal@bootlin.com>

arm64: dts: nuvoton: ma35d1: Add LXT crystal and correct HXT name

The clock controller takes its two crystal oscillator inputs from the
board: HXT and LXT. This commit fixes the HXT clock output name to "hxt"
instead of "clk_hxt", and adds the LXT fixed clock node.

> diff --git a/arch/arm64/boot/dts/nuvoton/ma35d1-iot-512m.dts b/arch/arm64/boot/dts/nuvoton/ma35d1-iot-512m.dts
> index 78534d613486a..cb7d6f9ee297e 100644
> --- a/arch/arm64/boot/dts/nuvoton/ma35d1-iot-512m.dts
> +++ b/arch/arm64/boot/dts/nuvoton/ma35d1-iot-512m.dts
> @@ -35,7 +35,14 @@ clk_hxt: clock-hxt {
>  		compatible = "fixed-clock";
>  		#clock-cells = <0>;
>  		clock-frequency = <24000000>;
> -		clock-output-names = "clk_hxt";
> +		clock-output-names = "hxt";

[Severity: High]
Could this change cause a regression with older kernels?

When booting an older kernel with this newly updated Device Tree,
of_clk_init() parses the DT and registers a fixed clock named "hxt".
Later, in drivers/clk/nuvoton/clk-ma35d1.c:ma35d1_clocks_probe(), the
driver unconditionally attempts to register its own fixed clock also named
"hxt", which fails due to the name collision and returns ERR_PTR(-EEXIST):

    hws[HXT] = ma35d1_clk_fixed("hxt", 24000000);

The driver does not validate the pointer and passes the ERR_PTR as a parent
for derived clocks like CAPLL:

    hws[CAPLL] = ma35d1_reg_clk_pll(dev, CAPLL, pllmode[0], "capll",
                                    hws[HXT], clk_base + REG_CLK_PLL0CTL0);

The Common Clock Framework (CCF) then dereferences the error pointer in
clk_core_fill_parent_index(), causing a fatal kernel panic on boot.

Although another commit in this series fixes the crash for the current
kernel by avoiding the error pointer dereference, it does not prevent the
regression on older kernels. The new DT will still crash older kernels
in the wild. Is there a way to describe the hardware without causing this
name collision?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260929-perso-ma35d1-upstream-clk-v5-0-68533e935ee4@bootlin.com?part=9

  reply	other threads:[~2026-09-29 15:01 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 14:44 [PATCH v5 0/9] clk: nuvoton: ma35d1: Fix mux parenting and peripheral clock rates Miquel Raynal
2026-09-29 14:44 ` [PATCH v5 1/9] clk: nuvoton: ma35d1: Keep the clock count in the driver Miquel Raynal
2026-09-29 14:44 ` [PATCH v5 2/9] dt-bindings: clock: ma35d1: Document the missing crystal inputs Miquel Raynal
2026-09-30 11:55   ` Krzysztof Kozlowski
2026-09-29 14:44 ` [PATCH v5 3/9] dt-bindings: clock: ma35d1: Drop CLK_MAX_IDX define Miquel Raynal
2026-09-29 14:44 ` [PATCH v5 4/9] dt-bindings: clock: ma35d1: Add missing WDT/WWDT parent clocks Miquel Raynal
2026-09-29 14:44 ` [PATCH v5 5/9] clk: nuvoton: " Miquel Raynal
2026-09-29 14:44 ` [PATCH v5 6/9] clk: nuvoton: ma35d1: Use clk_hw pointers as mux parents Miquel Raynal
2026-09-29 14:44 ` [PATCH v5 7/9] clk: nuvoton: ma35d1: Avoid possible error pointer dereferencing Miquel Raynal
2026-09-29 14:44 ` [PATCH v5 8/9] clk: nuvoton: ma35d1: get HXT/LXT from DT Miquel Raynal
2026-09-29 14:56   ` sashiko-bot
2026-09-29 20:36     ` Miquel Raynal
2026-09-30  7:39       ` Jerome Brunet
2026-09-30  9:12         ` Miquel Raynal
2026-09-29 14:44 ` [PATCH v5 9/9] arm64: dts: nuvoton: ma35d1: Add LXT crystal and correct HXT name Miquel Raynal
2026-09-29 15:01   ` sashiko-bot [this message]
2026-09-29 20:48     ` 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=20260929150121.739D91F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=miquel.raynal@bootlin.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