Linux-PHY Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Stefan Dösinger" <stefandoesinger@gmail.com>
Cc: lee@kernel.org, vkoul@kernel.org, linux-phy@lists.infradead.org,
	mfd@lists.linux.dev, neil.armstrong@linaro.org,
	devicetree@vger.kernel.org, olteanv@gmail.com, robh@kernel.org,
	conor+dt@kernel.org
Subject: Re: [PATCH v10 08/12] clk: zte: Introduce a driver for zx297520v3 top clocks
Date: Mon, 10 Aug 2026 07:15:00 +0000	[thread overview]
Message-ID: <20260810071501.0BFA01F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260810-zx29clk-v10-8-63846490712c@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] `ahb-wclk` is assigned the wrong parent mux, breaking the clock topology.
- [Low] The driver fails to compile because it uses `const` variables to initialize static array elements, which violates the C standard for constant expressions.
--

--- Patch [8]: [PATCH v10 08/12] clk: zte: Introduce a driver for zx297520v3 top clocks ---
commit e0f9a1aafed8640102d7aca0bbb0d89079e89c5f
Author: Stefan Dösinger <stefandoesinger@gmail.com>

clk: zte: Introduce a driver for zx297520v3 top clocks

This commit introduces a new clock driver for the ZTE zx297520v3 SoC.
It supports basic clocks, including PLLs, the AHB bus, timers, and the
USB controller.

> diff --git a/drivers/clk/zte/clk-zx297520v3.c b/drivers/clk/zte/clk-zx297520v3.c
> new file mode 100644
> index 0000000000000..504075590e6d2
> --- /dev/null
> +++ b/drivers/clk/zte/clk-zx297520v3.c
[ ... ]
> +static const struct zx_clock zx297520v3_top_clocks[] = {
[ ... ]
> +	/* osc26m division for clk_outX */
> +	[ZX_CLK_OSC26M_D2]         = FIXED_DIV("osc26m-d2", clk_main[0], 2),

[Severity: Low]
Will this cause a compiler error?

In standard C, variables qualified with const are not considered constant
expressions. Using clk_main array elements here to initialize elements of a
static array will likely trigger an initializer element is not constant error.

[ ... ]
> +	[ZX_CLK_WDT_T18_DIV]       = DIV("wdt-t18-div", PARENT_ID(ZX_CLK_WDT_T18_MUX),
> +					 0x48, 8, 4),
> +	[ZX_CLK_USIM1_DIV]         = DIV("usim1-div", clk_unknown,
> +					 0x48, 12, 1),

[Severity: Low]
Is this another place where a const variable (clk_unknown) will trigger a
compiler error when used as a static array initializer?

[ ... ]
> +	/*
> +	 * AHB clock gates: Disabling these cuts off the A53 from register access into 0x130000/
> +	 * 0x140000, including the topcrm region, so it can't be re-enabled. Mark them critical for
> +	 * that reason.
> +	 *
> +	 * Gating this off does not stop the M0 rproc, nor does it stop M0 from accessing topcrm. It
> +	 * does however gate off M0 from the AXI interconnect, so it can't read RAM, Matrix, etc. So
> +	 * these bits here merely gate the bus, not the actual devices.
> +	 */
> +	[ZX_CLK_AHB_PCLK]          = GATE("ahb-pclk", PARENT_ID(ZX_CLK_AHB_MUX), 0x54, 12,
> +					  CLK_IS_CRITICAL),
> +	[ZX_CLK_AHB_WCLK]          = GATE("ahb-wclk", PARENT_ID(ZX_CLK_M0_MUX), 0x54, 13,
> +					  CLK_IS_CRITICAL),

[Severity: Medium]
Does ahb-wclk have the wrong parent mux assigned here?

It is currently assigned ZX_CLK_M0_MUX instead of ZX_CLK_AHB_MUX. The comments
state that changing the AHB mux affects USB network speeds, which implies
that ZX_CLK_AHB_MUX is the actual hardware parent.

[ ... ]
> +	/*
> +	 * How does this RTC work? I don't know, the ZTE kernel does not talk to it. The actual RTC
> +	 * is on the I2C-connected PMIC.
> +	 */
> +	[ZX_CLK_RTC_WCLK]         = GATE("rtc-wclk", clk_unknown, 0x54, 1, 0),

[Severity: Low]
Will this face the same static array initializer error as the other usages
of clk_unknown?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260810-zx29clk-v10-0-63846490712c@gmail.com?part=8

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2026-08-10  7:15 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-09 21:28 [PATCH v10 00/12] ZTE zx297520v3 clock bindings and driver Stefan Dösinger
2026-08-09 21:28 ` [PATCH v10 01/12] dt-bindings: clk: zte: Add zx297520v3 top clock and reset controller Stefan Dösinger
2026-08-10  7:12   ` sashiko-bot
2026-08-10 15:38     ` Rob Herring
2026-08-10 18:49       ` Stefan Dösinger
2026-08-09 21:28 ` [PATCH v10 02/12] dt-bindings: clk: zte: Add zx297520v3 matrix " Stefan Dösinger
2026-08-10  7:07   ` sashiko-bot
2026-08-09 21:28 ` [PATCH v10 03/12] dt-bindings: clk: zte: Add zx297520v3 LSP " Stefan Dösinger
2026-08-10  7:05   ` sashiko-bot
2026-08-09 21:28 ` [PATCH v10 04/12] mfd: zx297520v3: Add a clock and reset MFD driver Stefan Dösinger
2026-08-10  7:10   ` sashiko-bot
2026-08-09 21:28 ` [PATCH v10 05/12] clk: zte: Add Clock registration infrastructure Stefan Dösinger
2026-08-10  7:17   ` sashiko-bot
2026-08-10 21:47   ` Brian Masney
2026-08-09 21:28 ` [PATCH v10 06/12] clk: zte: Add regmap-based clocks Stefan Dösinger
2026-08-10  7:10   ` sashiko-bot
2026-08-09 21:28 ` [PATCH v10 07/12] clk: zte: Add zx PLL support infrastructure Stefan Dösinger
2026-08-10  7:13   ` sashiko-bot
2026-08-10 21:56   ` Brian Masney
2026-08-09 21:28 ` [PATCH v10 08/12] clk: zte: Introduce a driver for zx297520v3 top clocks Stefan Dösinger
2026-08-10  7:15   ` sashiko-bot [this message]
2026-08-10 21:58   ` Brian Masney
2026-08-09 21:28 ` [PATCH v10 09/12] clk: zte: Introduce a driver for zx297520v3 matrix clocks Stefan Dösinger
2026-08-10  7:14   ` sashiko-bot
2026-08-10 21:59   ` Brian Masney
2026-08-09 21:28 ` [PATCH v10 10/12] clk: zte: Introduce a driver for zx297520v3 LSP clocks Stefan Dösinger
2026-08-10  7:10   ` sashiko-bot
2026-08-10 21:59   ` Brian Masney
2026-08-09 21:28 ` [PATCH v10 11/12] reset: zte: Add a zx297520v3 reset driver Stefan Dösinger
2026-08-10  7:15   ` sashiko-bot
2026-08-10  7:03 ` [PATCH v10 12/12] ARM: dts: zte: Declare zx297520v3 CRM device nodes Stefan Dösinger
2026-08-10  7:11   ` 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=20260810071501.0BFA01F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=mfd@lists.linux.dev \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=stefandoesinger@gmail.com \
    --cc=vkoul@kernel.org \
    /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