From: sashiko-bot@kernel.org
To: "Navid Ghahremani" <ghahramani.navid@gmail.com>
Cc: linux-clk@vger.kernel.org
Subject: Re: [PATCH v2 06/24] clk: zte: Add ZX279128S CRM clock and reset driver
Date: Thu, 15 Oct 2026 07:24:38 +0000 [thread overview]
Message-ID: <sashiko-outbox-172399@kernel.org> (raw)
In-Reply-To: <20261014072109.1759502-7-ghahramani.navid@gmail.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] clk: zte: boot failure when external oscillator is an orphan
- [Medium] clk: zte: incomplete disable and is_enabled implementation for CRM2 clocks
- [Low] clk: zte: unmet dependency risk from unconditional select of RESET_SIMPLE
--
commit 46157610926015842fd1aee202e8fff3cbf39169
Author: Navid Ghahremani <ghahramani.navid@gmail.com>
clk: zte: Add ZX279128S CRM clock and reset driver
This commit adds support for the top CRM and low-speed peripheral clock
controllers for the ZTE ZX279128S SoC. It implements custom reset controller
operations and provides CRM2 clock gating along with reset controller support
for PCIe.
> diff --git a/drivers/clk/zte/Kconfig b/drivers/clk/zte/Kconfig
> new file mode 100644
> index 0000000000000..92fd27ea42b2f
> --- /dev/null
> +++ b/drivers/clk/zte/Kconfig
> @@ -0,0 +1,14 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +config CLK_ZX279128S
> + bool "ZTE zx279128s clock driver"
> + depends on SOC_ZX279128S || COMPILE_TEST
> + depends on OF
> + default SOC_ZX279128S
> + select RESET_CONTROLLER
> + select RESET_SIMPLE
[Severity: Low]
Does unconditionally selecting RESET_SIMPLE cause an unmet dependency
warning on platforms without HAS_IOMEM (like UML)?
Since the driver implements its own custom reset operations (zx_reset_ops,
zx_crm2_reset_ops) and doesn't use the reset-simple framework, is it possible
to drop the select RESET_SIMPLE entirely?
[ ... ]
> diff --git a/drivers/clk/zte/clk-zx279128s.c b/drivers/clk/zte/clk-zx279128s.c
> new file mode 100644
> index 0000000000000..892e0c22e5f26
> --- /dev/null
> +++ b/drivers/clk/zte/clk-zx279128s.c
[ ... ]
> +static void __init zx279128s_topcrm_init(struct device_node *np)
> +{
> + const struct clk_hw *cpu_parents[4], *matrix_parents[4];
> + struct clk_hw *osc, *lsp, *lsp_500m, *lsp_250m, *lsp_125m, *lsp_100m;
> + struct clk_hw *audio, *audio_32k, *matrix, *hclk, *pclk, *m200, *m20;
> + struct clk_hw_onecell_data *data;
> + struct clk_hw **hws;
> + void __iomem *base, *en;
> + int i;
> +
> + base = of_iomap(np, 0);
> + if (!base) {
> + pr_err("%pOF: no registers\n", np);
> + return;
> + }
> +
> + data = kzalloc(struct_size(data, hws, TOP_NUM_CLKS), GFP_KERNEL);
> + if (!data)
> + return;
> + data->num = TOP_NUM_CLKS;
> + hws = data->hws;
> +
> + hws[ZX279128S_TOP_PLL_A9] = zx_top_pll(np, "pll_a9", base + TOP_PLL_A9);
> + if (IS_ERR(hws[ZX279128S_TOP_PLL_A9]))
> + goto err;
> + osc = clk_hw_get_parent(hws[ZX279128S_TOP_PLL_A9]);
> + if (!osc)
> + goto err;
[Severity: High]
Does treating a missing parent as a fatal error here break the boot process
if the external "osc" clock is not yet registered?
If the external "osc" clock is an orphan due to probe sequence or driver
loading order, clk_hw_get_parent() will return NULL. Treating this as an error
silently aborts the initialization of all CRM clocks.
Could we instead use fw_name = "osc" (or other suitable clk_parent_data
constructs) for downstream clocks, allowing the Common Clock Framework
to handle orphan resolution naturally?
[ ... ]
> +static void zx_crm2_clk_disable(struct clk_hw *hw)
> +{
> + struct zx_crm2_gate *gate = to_zx_crm2_gate(hw);
> + unsigned long flags;
> + u32 val;
> +
> + spin_lock_irqsave(gate->lock, flags);
> + val = readl(gate->reg);
> + val &= ~gate->clk_on;
> + writel(val, gate->reg);
[Severity: Medium]
In zx_crm2_clk_enable(), the gate->clk_off bits are cleared to enable the
clock. Should zx_crm2_clk_disable() restore those clk_off bits when disabling?
By only clearing the clk_on bits, this might leave the hardware partially
active or fail to properly isolate the clock domain.
> + spin_unlock_irqrestore(gate->lock, flags);
> +}
> +
> +static int zx_crm2_clk_is_enabled(struct clk_hw *hw)
> +{
> + struct zx_crm2_gate *gate = to_zx_crm2_gate(hw);
> + u32 val = readl(gate->reg);
> +
> + return (val & gate->clk_on) == gate->clk_on;
[Severity: Medium]
Does this status check need to account for the gate->clk_off bits as well?
If the clock is currently in a disabled state (e.g., clk_off bits set by the
bootloader), this function will report it as enabled if the clk_on bits happen
to be set. This would prevent the Common Clock Framework from ever calling
enable() to clear those isolation bits.
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261014072109.1759502-1-ghahramani.navid@gmail.com?part=6
next prev parent reply other threads:[~2026-10-15 7:24 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 7:20 [PATCH v2 00/24] ARM: zte: Add support for Sanechips ZX279128S and ZTE ZXHN H3600 Navid Ghahremani
2026-10-14 7:20 ` [PATCH v2 01/24] MAINTAINERS: Consolidate ARM/ZTE ZX SOC SUPPORT with Stefan Doesinger Navid Ghahremani
2026-10-14 20:11 ` Stefan Dösinger
2026-10-14 7:20 ` [PATCH v2 02/24] dt-bindings: arm: Add ZTE ZX279128S platform descriptions Navid Ghahremani
2026-10-14 7:20 ` [PATCH v2 03/24] ARM: zte: Add ZX279128S platform and CPU hotplug support Navid Ghahremani
2026-10-14 7:20 ` [PATCH v2 04/24] dt-bindings: clock: Add ZTE ZX279128S CRM clock bindings Navid Ghahremani
2026-10-14 21:48 ` Stefan Dösinger
2026-10-15 7:24 ` sashiko-bot
2026-10-15 9:25 ` Krzysztof Kozlowski
2026-10-15 9:26 ` Krzysztof Kozlowski
2026-10-14 7:20 ` [PATCH v2 05/24] dt-bindings: reset: Add ZTE ZX279128S reset controller bindings Navid Ghahremani
2026-10-15 7:24 ` sashiko-bot
2026-10-15 9:27 ` Krzysztof Kozlowski
2026-10-14 7:20 ` [PATCH v2 06/24] clk: zte: Add ZX279128S CRM clock and reset driver Navid Ghahremani
2026-10-14 13:21 ` Philipp Zabel
2026-10-14 19:39 ` Stefan Dösinger
2026-10-15 7:24 ` sashiko-bot [this message]
2026-10-14 7:20 ` [PATCH v2 07/24] dt-bindings: gpio: Add ZTE ZX279128S GPIO controller Navid Ghahremani
2026-10-14 7:20 ` [PATCH v2 08/24] gpio: Add ZTE ZX279128S GPIO driver Navid Ghahremani
2026-10-14 21:11 ` Stefan Dösinger
2026-10-15 12:25 ` Bartosz Golaszewski
2026-10-14 7:20 ` [PATCH v2 09/24] dt-bindings: pinctrl: pinctrl-single: Add ZTE ZX279128S pin mux Navid Ghahremani
2026-10-14 7:20 ` [PATCH v2 10/24] dt-bindings: phy: Add ZTE ZX279128S PCIe PHY binding Navid Ghahremani
2026-10-14 7:20 ` Navid Ghahremani
2026-10-15 7:24 ` sashiko-bot
2026-10-15 7:24 ` sashiko-bot
2026-10-15 9:29 ` Krzysztof Kozlowski
2026-10-15 9:29 ` Krzysztof Kozlowski
2026-10-14 7:20 ` [PATCH v2 11/24] phy: zte: Add ZTE ZX279128S PCIe PHY driver Navid Ghahremani
2026-10-14 7:20 ` Navid Ghahremani
2026-10-15 7:24 ` sashiko-bot
2026-10-14 7:20 ` [PATCH v2 12/24] dt-bindings: PCI: Add ZTE ZX279128S host controller Navid Ghahremani
2026-10-15 7:24 ` sashiko-bot
2026-10-14 7:20 ` [PATCH v2 13/24] PCI: dwc: Add ZTE ZX279128S host controller driver Navid Ghahremani
2026-10-14 13:19 ` Bjorn Helgaas
2026-10-14 21:06 ` Stefan Dösinger
2026-10-15 7:24 ` sashiko-bot
2026-10-14 7:20 ` [PATCH v2 14/24] dt-bindings: net: Add ZTE ZX279128S MDIO controller Navid Ghahremani
2026-10-14 7:20 ` [PATCH v2 15/24] net: mdio: " Navid Ghahremani
2026-10-14 12:13 ` Andrew Lunn
2026-10-14 7:20 ` [PATCH v2 16/24] net: phy: Add Sanechips ZX5201 PHY support Navid Ghahremani
2026-10-14 12:37 ` Andrew Lunn
2026-10-14 7:20 ` [PATCH v2 17/24] dt-bindings: net: Add ZTE ZX279128S Ethernet switch Navid Ghahremani
2026-10-14 7:20 ` [PATCH v2 18/24] net: ethernet: zte: Add ZX279128S Ethernet switch driver Navid Ghahremani
2026-10-14 7:20 ` [PATCH v2 19/24] dt-bindings: spi: Add ZTE ZX family SPI flash controller binding Navid Ghahremani
2026-10-14 20:33 ` Stefan Dösinger
2026-10-15 9:35 ` Krzysztof Kozlowski
2026-10-15 9:36 ` Krzysztof Kozlowski
2026-10-14 7:21 ` [PATCH v2 20/24] spi: zx: Add ZTE ZX family SPI flash controller driver Navid Ghahremani
2026-10-14 19:28 ` Stefan Dösinger
2026-10-15 9:34 ` Krzysztof Kozlowski
2026-10-15 14:29 ` kernel test robot
2026-10-14 7:21 ` [PATCH v2 21/24] dt-bindings: usb: Add ZTE ZX279128S DWC3 controller Navid Ghahremani
2026-10-15 7:24 ` sashiko-bot
2026-10-14 7:21 ` [PATCH v2 22/24] usb: dwc3: generic-plat: Add ZTE ZX279128S Navid Ghahremani
2026-10-15 7:24 ` sashiko-bot
2026-10-14 7:21 ` [PATCH v2 23/24] ARM: dts: zte: Add ZX279128S SoC description Navid Ghahremani
2026-10-14 7:21 ` [PATCH v2 24/24] ARM: dts: zte: Add ZTE ZXHN H3600 board Navid Ghahremani
2026-10-14 12:52 ` Andrew Lunn
2026-10-15 7:24 ` sashiko-bot
2026-10-14 20:00 ` [PATCH v2 00/24] ARM: zte: Add support for Sanechips ZX279128S and ZTE ZXHN H3600 Stefan Dösinger
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=sashiko-outbox-172399@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ghahramani.navid@gmail.com \
--cc=linux-clk@vger.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.