Article View: linux.kernel.netdev
Article #18013Re: [PATCH 5/9] arm64: dts: rockchip: Add the PHP GRF clock on RK3588
From: netdev-bot+sashiko
Date: Tue, 17 Nov 2026 17:35
Date: Tue, 17 Nov 2026 17:35
146 lines
13972 bytes
13972 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] Adding `clocks = <&cru PCLK_PHP_ROOT>` to php_grf creates a DT
dependency cycle: the cru node has `rockchip,grf = <&php_grf>`…
- [Low] Once the clock is attached, regmap-mmio wraps every PHP GRF
access in clk_enable()/clk_disable() (regmap_mmio_write lines 157/165,…
--
arm64: dts: rockchip: Add the PHP GRF clock on RK3588
This adds a PCLK_PHP_ROOT clock reference to the php_grf syscon node on
RK3588, so that the syscon regmap enables pclk_php_root around PHP GRF
accesses. The motivation is a deep suspend hang in the syscore resume op
added by the next patch, which ran after the PHP peripherals had gated
pclk_php_root.
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
> index d0f364547ae55..8807ce6193bfc 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
> @@ -619,6 +619,7 @@ usb_grf: syscon@fd5ac000 {
> php_grf: syscon@fd5b0000 {
> compatible = "rockchip,rk3588-php-grf", "syscon";
> reg = <0x0 0xfd5b0000 0x0 0x1000>;
> + clocks = <&cru PCLK_PHP_ROOT>;
[Severity: Medium]
Does this create a dependency cycle with the cru node? The cru node in
this same file already has:
rockchip,grf = <&php_grf>;
and php_grf now references a clock that cru provides.
On RK3588 the CRU looks up its GRF from the CLK_OF_DECLARE_DRIVER hook,
before its own clock provider is registered:
of_clk_init()
rk3588_clk_early_init()
rockchip_clk_init_early()
rockchip_clk_init_base()
syscon_regmap_lookup_by_phandle(ctx->cru_node, "rockchip,grf")
of_syscon_register(php_grf, check_res=true)
of_clk_get(np, 0) <- now returns -EPROBE_DEFER
...
rockchip_clk_of_add_provider(np, ctx) <- provider only added here
of_syscon_register() only treats -ENOENT as a missing clock:
drivers/mfd/syscon.c:of_syscon_register() {
...
clk = of_clk_get(np, 0);
if (IS_ERR(clk)) {
ret = PTR_ERR(clk);
/* clock is optional */
if (ret != -ENOENT)
goto err_clk;
...
}
So the regmap is torn down and nothing is cached. clk_rk3588_probe()
reuses early_ctx and never retries the lookup. Would ctx->grf then stay
ERR_PTR(-EPROBE_DEFER) for good? Before this patch it was a valid php_grf
regmap.
Nothing on RK3588 seems to dereference ctx->grf today. The pll_rk3588 ops
don't use it, and the GATE_GRF branches use grf_type_sys from
aux_grf_table. However, rockchip_clk_register_branches() falls back to it
for grf mux/gate/mmc branches that have no matching aux GRF:
struct regmap *grf = ctx->grf;
A future branch like that would silently get an error pointer.
There is also a second interaction. Before this patch, the CRU's early
lookup was the first to create and cache the php_grf regmap, and it did so
without a clock. Every later syscon_node_to_regmap() user got that
clockless regmap: rockchip_grf_init(), dwmac-rk via rockchip,php-grf, and
naneng-combphy via rockchip,pipe-grf.
With this patch, the clock only gets attached because the CRU lookup
fails. That failure moves the first successful creation to
rockchip_grf_init() at postcore_initcall, when PCLK_PHP_ROOT is already
available.
If the CRU lookup were moved after provider registration, or some earlier
caller created the regmap without the clock, a clockless regmap would be
cached again. The restore op in the following patch "soc: rockchip: grf:
Restore the RK3588 PHP StreamIDs after system suspend" only checks
of_property_present(np, "clocks"). It doesn't check whether the cached
regmap actually carries the clock. Wouldn't deep suspend hang again in
that case?
Should the commit message describe this ordering dependency and the
effect on ctx->grf?
[Severity: Low]
With the clock attached, regmap-mmio wraps each PHP GRF access in
clk_enable()/clk_disable(). Does this change when pclk_php_root is gated
in hardware?
rockchip_grf_init() runs at postcore_initcall. After the earlier patch
"soc: rockchip: grf: Assign the StreamIDs of the RK3588 PHP SMMU masters",
it writes 12 StreamID registers through this regmap. At that point no PHP
consumer holds pclk_php_root, and the clock is a plain gate with flags 0:
COMPOSITE_NODIV(PCLK_PHP_ROOT, "pclk_php_root", mux_150m_50m_24m_p, 0,
So each write takes enable_count from 0 to 1 and back to 0:
rockchip_grf_init()
regmap_write()
regmap_mmio_write()
clk_enable()
...
clk_disable()
clk_core_disable()
core->ops->disable()
clk_core_disable(core->parent)
Before this patch, the clock kept its bootloader state until
clk_disable_unused at late_initcall_sync. With clk_ignore_unused it was
never touched. Now it is gated at postcore_initcall, along with any parent
whose count also drops to zero, and this happens even with
clk_ignore_unused.
Could a PHP-domain register access in that window now hang? The same
question applies to an access under clk_ignore_unused that relied on the
bootloader leaving the clock on.
The commit message says the regmap enables the clock. It doesn't mention
that the regmap also gates it this early.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261113-mmu600-php-v1-0-231196049a3b%40gmail.com
Technical Details
Message-ID:
<179493691507.3136.7881513635093439298@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365498-linux-kernel-netdev=dewy.ruReferences:
<20261113-mmu600-php-v1-5-231196049a3b@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365498-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH 5/9] arm64: dts: rockchip: Add the PHP GRF clock on RK3588 Date: Tue, 17 Nov 2026 17:35:15 +0000 Organization: Usenet Network Message-ID: <179493691507.3136.7881513635093439298@kernel.org> References: <20261113-mmu600-php-v1-5-231196049a3b@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2388970"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:5pCW81Kh60GOLIAh0VdEji5eT+s= sha256:5Xnq1L5KvvJlhx3jq+WXapN0mZKQbTMBsKZkN03h9ek= sha1:XadYzmjXKAasegJ6tUr4SatxYwc= sha256:CYmAMmwEnMm7xWLMuo1lnmVzUXFC+DImxsdnI6nWIR4= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 77191114FFE; Tue, 17 Nov 2026 20:35:34 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TkOADZlOxGlv; Tue, 17 Nov 2026 20:35:30 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-365498-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 72ADF115011; Tue, 17 Nov 2026 20:35:21 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 7FE7360E1B1; Tue, 17 Nov 2026 17:35:21 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794936917; b=5WATlplXLwH9kDM4hCGjhh6TOJnvz4XQ6AjEJh56ibTdX4jAxRgyawNTyqiLU/IYWKNI keEQ3PF9LBwz61+OM/yBumA0yAgcEZS2tvnPKQne+G7tRN07GdmbNvBx3eo9KzkV++zTp db1VqwME0yFvLU4qlM9ebLFl3pB/MJbmayTfrvOuz0EaXpFGMq+RAXgl7UD1BXBmPxMFM 5i8M+AzUwrTH40uu9Fzov7JHR5MA2hTDxrrhwDe4xcVypJr86iRmAN4edH0D59gVxBDGU V9MEuj9xcITV6e/1cVTRbD991svWHG92QqISQpW2+dzOiRe1Ii8ztUVPCmJePqEXdAw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794936917; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=xNa0xDXSS+zJh+Kso81OgDVFRXsupSK+qlsYOnCFju8=; b=C40yWSssg9erCZfjq7KTJrPzMZ3b3rB/ICcz+OYHKTrKyjjz4VuYEO1RneUCYYYpArYw LOQSbSOV5m3BRvwPjsKqaFYcPyklnlEwHORWrOVw0ySsJTBX7Q36IAvVpBFOfz8UIBSoa E2+gKLql8pa3WjfyEBozLDuEiZoyU4nXeahdPvVKL9if6wJIyavBPWLYe4XGs1PDQaIh8 Ng3SwJQemVvt7u5HL0EPDlac2YWLuYWCItTPg0xNoXiBeEhBVLjmLIGADN42cD6/9KCwk MDkaemLcnnScBoC5K+Ha/h0lsc2qwh7XS25dKWuIAieS6LwUSHQB7C2VZBRzTZW8nyg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="f/Rk9Z+/"; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C23F6606A8B2; Tue, 17 Nov 2026 17:35:17 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=f/Rk9Z+/ X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794936916; b=0R3nz1z3p7R6ThCczNYQ3I/Kp0F41HxjChWLhB6a6rTTEVGviSbgKOGg2JE4h4VB+zJK FsTz5HuUS9Ye99JT4d/rtZc2pjAXke3DbplsHl1BDAtjuwlJlGL9cM7GpA4ve1FVHy0Rg HlN6B/BoUEC2ehHLJnvXgRlZupB4JsA4mDV+lk4LC/mF0zR9wZuVDLsG3s5AwVKWWc7i5 UxMghPYBKO5fI7V59OFYi0+9ZgIRfTKXLItiQ2qsnJHYZjeK3mWJp/Q4gDvWH7Q8hTAFb ka9sLSjzC9E9V3BS+pQ7lMb41zJuQMQQLe8gsDPcpiH2nYJ4DhrIf9aQ5UouyvrnY+A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794936916; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=xNa0xDXSS+zJh+Kso81OgDVFRXsupSK+qlsYOnCFju8=; b=1VRYK1wUYLePc/fH4+Vy8U1ta4A/LPBU1DcG0zAJeEzBCYdA0/Jz4QfduoNi8on9EVoY zMtqSbTk48tQEazlc+imAKw668r+/Mho8CukS64vP9Cuh9vOz0cCK+XNif51qdstzaBEY 6MoYKp6nmaWt/PmPMsZeAN8LesMpY2VLtz+mhb8lAdO6d81027huTMAYroUYaPfaR7hGW PgtxXF1C8NSggkbPqwnYamcFJlGzyzvzDQD1B8hAqroP9pFh59PUSrfuId7UzqXCimnXc StUxr6SLe/Cybt8AINdVCmzflurPL2tFHMPgu7OyiDyEswWt84WZUt99BzdT0NaITRg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="f/Rk9Z+/"; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD108606A339; Tue, 17 Nov 2026 17:35:16 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78B591F000CC; Tue, 17 Nov 2026 17:35:15 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794936916; bh=xNa0xDXSS+zJh+Kso81OgDVFRXsupSK+qlsYOnCFju8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=f/Rk9Z+/w2sDE60G7c5yxPTEM8K3B3ApYnUWzJ9FKtTrQ0MgX0uDktfKkK95bd83T EHf0Wit/AhL7mxkmpqZJi1f5kTRmMy2cvT84rmk+DxfSpRUyuBL9fqfKfyfwQCJ5oQ RYvwKhBPD5BSvXNEZyY0XkZjHhk9KrlHQXnltMjJdlRGBrfsTjd0uMSEm7f355Qxg1 mh+Cse4brl6p2aGfHzWaallLHet7TQYHAn6UzoPdL4XxJVPeAQsX/TGTmoWANB+Vhc VFgLsBmzjBD4Z0vsXINFmchPjf5F77TWPoq3EHaD13BZlzo3ASfzMFsXa5blTcqhom Ajxv+5E12C+hQ== X-Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, heiko@sntech.de, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, david.wu@rock-chips.com, dlemoal@kernel.org, cassel@kernel.org, fancer.lancer@gmail.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, praan@google.com, will@kernel.org, robin.murphy@arm.com, iommu@lists.linux.dev, shawn.lin@rock-chips.com, sebastian.reichel@collabora.com X-In-Reply-To: <20261113-mmu600-php-v1-5-231196049a3b@gmail.com> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-Received-Bytes: 13686