Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Arun Iyengar via B4 Relay
Fri, 13 Nov 2026 16:38
[PATCH 5/9] arm64: dts: rockchip: Add the PHP GRF clock on RK3588
Author: Arun Iyengar via B4 Relay
Date: Fri, 13 Nov 2026 16:38
Date: Fri, 13 Nov 2026 16:38
27 lines
11903 bytes
11903 bytes
From: Arun Iyengar <aiyengar1990@gmail.com>
Once the PHP peripherals suspend, pclk_php_root is gated and a PHP GRF
access hangs; the syscore resume op of the next patch hung deep suspend
this way. Add the clock, so the syscon regmap enables it.
Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
---
arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
index d0f364547ae5..8807ce6193bf 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>;
};
csidphy0_grf: syscon@fd5b4000 {
--
2.55.0
Re: [PATCH 5/9] arm64: dts: rockchip: Add the PHP GRF clock on RK3588
Author: 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads