* clk: eswin: eic7700: EIC7702X hangs when disabling unused D2D/PVT gates
@ 2026-11-22 19:18 Mervyn Pretorius
2026-11-23 7:11 ` Xuyang Dong
0 siblings, 1 reply; 2+ messages in thread
From: Mervyn Pretorius @ 2026-11-22 19:18 UTC (permalink / raw)
To: Yifeng Huang, Xuyang Dong
Cc: Stephen Boyd, Brian Masney, Jerome Brunet, linux-clk, linux-riscv,
Min Lin, Pinkesh Vaghela, Pritesh Patel
Hi,
On a DeepComputing FML13V03 board (ESWIN EIC7702X, i.e. two EIC7700X
dies, 32 GiB), mainline hangs during or shortly after
clk_disable_unused() unless clk_ignore_unused is given. Marking
gate_d2d_aclk (and, as a precaution, gate_lsp_pvt_pclk) as
CLK_IS_CRITICAL in drivers/clk/eswin/clk-eic7700.c fixes it here; I'd
like to know whether that is the right fix or whether something else
should claim these clocks.
Setup:
- v7.4-rc3 (4843f6873f7c) + "riscv: eswin: eic7700: Add support for
clocks, resets, pinctrl, HSP bus, I2C and watchdog" v5
(https://lore.kernel.org/r/20261015125454.1381941-1-pinkesh.vaghela@einfochips.com)
+ a minimal local board dts: die 0 only (4 of the 8 harts, uart0,
the firmware reserved-memory regions).
- defconfig + PINCTRL_EIC7700, DW_WATCHDOG, RISCV_SBI_V01.
- OpenSBI v1.3, U-Boot 2024.01, D2D firmware 1.51, GRUB (EFI). Under
EFI the kernel takes RAM from the EFI memory map, so it also uses the
second die's 16 GiB although the dts only describes die 0.
- Plain command line: earlycon=sbi console=ttyS0,115200n8 rdinit=/init
(initramfs only). To find the clocks I used a local debug-only option
that keeps named clocks on in clk_disable_unused_subtree() (not meant
for merging); some of those boots also had keep_bootcon and
trace_event=clk:clk_disable tp_printk, called "traced" below.
What I see on the serial console:
- gate_d2d_aclk: every boot that disabled it failed to reach init: 1
traced boot that left only this gate out of a larger kept set, 3
plain boots that kept only gate_lsp_pvt_pclk on (2 with all 32 GiB,
1 with mem=16G), and the stock boots with nothing kept (32 GiB and
mem=16G). With 32 GiB the traced boot stops right at
this gate. With mem=16G (Linux on die 0 RAM only) the boot stalls
before init; ~21 s later RCU reports a stall, and CPU 2 then does not
respond to the NMI ("After 10 seconds, these CPUS still haven't
responded to the NMI: 2"). Keeping only this gate on, with every
other unused gate disabled, boots to an initramfs shell with 32 GiB
(2 boots) and with mem=16G (1 boot).
- gate_lsp_pvt_pclk: intermittent. I have 10 boots that disabled it
while gate_d2d_aclk stayed on. In 4 of the 7 traced ones (which make
the disable pass much slower; 5 of the 7 were earlier mem=16G boots
with other clocks kept on as well), the D2D firmware printed, within
tens of milliseconds, the following (from one of them; colour codes
removed, and the first line's "D2D NOTI" prefix was interleaved with
kernel output):
D2D NOTICE: ΔT 60.691°C (prev 46.329, curr 107.020)
D2D FAIL: T:107.020 sts:00000007 rx:00e60001 rx2:00e60001 [RX ERR ALL|RX LOCAL LINKUP|RX REMOTE LINKUP]
and Linux hung. In the other 3 traced boots and in all 3 plain boots,
disabling it caused no visible problem. I don't know why it is
intermittent. A jump from 46 to 107 °C between two firmware samples
looks like an invalid sensor read once this clock is off, but I
can't see the firmware side.
- With both gates marked CLK_IS_CRITICAL (diff below; no other change,
no debug option, no clk_ignore_unused) and the plain command line,
the board boots with all 32 GiB, and 92 previously enabled unused
gates are disabled (113 unclaimed gates were on in a clk_ignore_unused
boot; the 21 left on are the 19 flagged CLK_IGNORE_UNUSED plus these
two). Writing and reading back 27 x 1 GiB in tmpfs (so the second
die's RAM is in use) gives identical checksums, and reboot -f returns
to the firmware.
- gate_pvt0_clk and gate_pvt1_clk were disabled in all of the boots
above that kept only one or both of the two gates, without preventing
boot. I have not checked whether the PVT sensors still give live
readings with them off.
Not tested: single-die EIC7700X, suspend/poweroff, the second die's
harts, anything beyond an initramfs shell.
Questions:
1. Is CLK_IS_CRITICAL right for gate_d2d_aclk (at least on EIC7702X,
where the D2D link is in use), and for gate_lsp_pvt_pclk? Or should
DT consumers (a D2D node, the PVT node) claim them instead?
2. Does the D2D firmware read the PVT sensor through gate_lsp_pvt_pclk,
and are gate_pvt0_clk/gate_pvt1_clk needed for live readings?
The change I tested:
@@ -828,5 +828,6 @@ static struct eswin_clk_info eic7700_clks[] = {
CLK_SET_RATE_PARENT, EIC7700_REG_OFFSET_DSP_CFG, 31, 0),
ESWIN_GATE_TYPE(EIC7700_CLK_GATE_D2D_ACLK, "gate_d2d_aclk",
- EIC7700_CLK_DIV_D2D_ACLK_DYNM, CLK_SET_RATE_PARENT,
+ EIC7700_CLK_DIV_D2D_ACLK_DYNM,
+ CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
EIC7700_REG_OFFSET_D2D_ACLK, 31, 0),
ESWIN_GATE_TYPE(EIC7700_CLK_GATE_D2D_CFG_CLK, "gate_d2d_cfg_clk",
@@ -1174,5 +1175,6 @@ static struct eswin_clk_info eic7700_clks[] = {
ESWIN_GATE_TYPE(EIC7700_CLK_GATE_LSP_PVT_PCLK, "gate_lsp_pvt_pclk",
EIC7700_CLK_MUX_SYSCFG_CLK_ROOT_2MUX1_GFREE,
- CLK_SET_RATE_PARENT, EIC7700_REG_OFFSET_LSP_EN0, 1, 0),
+ CLK_SET_RATE_PARENT | CLK_IS_CRITICAL,
+ EIC7700_REG_OFFSET_LSP_EN0, 1, 0),
ESWIN_GATE_TYPE(EIC7700_CLK_GATE_LSP_PVT0_CLK, "gate_pvt0_clk",
EIC7700_CLK_FIXED_FACTOR_PVT_DIV20, CLK_SET_RATE_PARENT,
Happy to send a proper patch once the preferred approach is clear; I
can also share the board dts and the serial logs.
Thanks,
Mervyn Pretorius
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: clk: eswin: eic7700: EIC7702X hangs when disabling unused D2D/PVT gates
2026-11-22 19:18 clk: eswin: eic7700: EIC7702X hangs when disabling unused D2D/PVT gates Mervyn Pretorius
@ 2026-11-23 7:11 ` Xuyang Dong
0 siblings, 0 replies; 2+ messages in thread
From: Xuyang Dong @ 2026-11-23 7:11 UTC (permalink / raw)
To: Mervyn Pretorius, Pinkesh Vaghela
Cc: Yifeng Huang, Stephen Boyd, Brian Masney, Jerome Brunet,
linux-clk, linux-riscv, Min Lin, Pritesh Patel, Xuyang Dong
>
> On a DeepComputing FML13V03 board (ESWIN EIC7702X, i.e. two EIC7700X
> dies, 32 GiB), mainline hangs during or shortly after
> clk_disable_unused() unless clk_ignore_unused is given. Marking
> gate_d2d_aclk (and, as a precaution, gate_lsp_pvt_pclk) as
> CLK_IS_CRITICAL in drivers/clk/eswin/clk-eic7700.c fixes it here; I'd
> like to know whether that is the right fix or whether something else
> should claim these clocks.
>
> Setup:
> - v7.4-rc3 (4843f6873f7c) + "riscv: eswin: eic7700: Add support for
> clocks, resets, pinctrl, HSP bus, I2C and watchdog" v5
> (https://lore.kernel.org/r/20261015125454.1381941-1-pinkesh.vaghela@einfochips.com)
> + a minimal local board dts: die 0 only (4 of the 8 harts, uart0,
> the firmware reserved-memory regions).
> - defconfig + PINCTRL_EIC7700, DW_WATCHDOG, RISCV_SBI_V01.
> - OpenSBI v1.3, U-Boot 2024.01, D2D firmware 1.51, GRUB (EFI). Under
> EFI the kernel takes RAM from the EFI memory map, so it also uses the
> second die's 16 GiB although the dts only describes die 0.
> - Plain command line: earlycon=sbi console=ttyS0,115200n8 rdinit=/init
> (initramfs only). To find the clocks I used a local debug-only option
> that keeps named clocks on in clk_disable_unused_subtree() (not meant
> for merging); some of those boots also had keep_bootcon and
> trace_event=clk:clk_disable tp_printk, called "traced" below.
>
> What I see on the serial console:
>
> - gate_d2d_aclk: every boot that disabled it failed to reach init: 1
> traced boot that left only this gate out of a larger kept set, 3
> plain boots that kept only gate_lsp_pvt_pclk on (2 with all 32 GiB,
> 1 with mem=16G), and the stock boots with nothing kept (32 GiB and
> mem=16G). With 32 GiB the traced boot stops right at
> this gate. With mem=16G (Linux on die 0 RAM only) the boot stalls
> before init; ~21 s later RCU reports a stall, and CPU 2 then does not
> respond to the NMI ("After 10 seconds, these CPUS still haven't
> responded to the NMI: 2"). Keeping only this gate on, with every
> other unused gate disabled, boots to an initramfs shell with 32 GiB
> (2 boots) and with mem=16G (1 boot).
>
> - gate_lsp_pvt_pclk: intermittent. I have 10 boots that disabled it
> while gate_d2d_aclk stayed on. In 4 of the 7 traced ones (which make
> the disable pass much slower; 5 of the 7 were earlier mem=16G boots
> with other clocks kept on as well), the D2D firmware printed, within
> tens of milliseconds, the following (from one of them; colour codes
> removed, and the first line's "D2D NOTI" prefix was interleaved with
> kernel output):
>
> D2D NOTICE: ΔT 60.691°C (prev 46.329, curr 107.020)
> D2D FAIL: T:107.020 sts:00000007 rx:00e60001 rx2:00e60001 [RX ERR ALL|RX LOCAL LINKUP|RX REMOTE LINKUP]
>
> and Linux hung. In the other 3 traced boots and in all 3 plain boots,
> disabling it caused no visible problem. I don't know why it is
> intermittent. A jump from 46 to 107 °C between two firmware samples
> looks like an invalid sensor read once this clock is off, but I
> can't see the firmware side.
>
> - With both gates marked CLK_IS_CRITICAL (diff below; no other change,
> no debug option, no clk_ignore_unused) and the plain command line,
> the board boots with all 32 GiB, and 92 previously enabled unused
> gates are disabled (113 unclaimed gates were on in a clk_ignore_unused
> boot; the 21 left on are the 19 flagged CLK_IGNORE_UNUSED plus these
> two). Writing and reading back 27 x 1 GiB in tmpfs (so the second
> die's RAM is in use) gives identical checksums, and reboot -f returns
> to the firmware.
>
> - gate_pvt0_clk and gate_pvt1_clk were disabled in all of the boots
> above that kept only one or both of the two gates, without preventing
> boot. I have not checked whether the PVT sensors still give live
> readings with them off.
>
> Not tested: single-die EIC7700X, suspend/poweroff, the second die's
> harts, anything beyond an initramfs shell.
>
> Questions:
> 1. Is CLK_IS_CRITICAL right for gate_d2d_aclk (at least on EIC7702X,
> where the D2D link is in use), and for gate_lsp_pvt_pclk? Or should
> DT consumers (a D2D node, the PVT node) claim them instead?
> 2. Does the D2D firmware read the PVT sensor through gate_lsp_pvt_pclk,
> and are gate_pvt0_clk/gate_pvt1_clk needed for live readings?
>
Hi Mervyn and Pinkesh,
Thanks for testing and for raising these questions about the EIC7702X.
On question 1: for the EIC7702X (dual-die), gate_d2d_aclk should be
marked CLK_IGNORE_UNUSED/CLK_IS_CRITICAL. That clock needs to stay
enabled in the dual-die case.
On question 2: you can add a PVT node and let the PVT driver manage
gate_lsp_pvt_pclk as well as gate_pvt0_clk/gate_pvt1_clk. The PVT driver
is already in 7.4-rc3 (with compatible = "eswin,eic7700-pvt"), but the
dts in the [1] series does not include a PVT node.
Pinkesh, could you check whether a PVT node should be added in the [1] series?
We haven't submitted dual-die support upstream yet. For dual-die support,
you can refer to the patches below:
https://github.com/DC-DeepComputing/DC-linux/tree/eic770x-v7.2-rc4
Thanks again for your work on this.
[1] https://lore.kernel.org/all/20261015125454.1381941-1-pinkesh.vaghela@einfochips.com/
Best regards,
Xuyang Dong
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-23 7:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 19:18 clk: eswin: eic7700: EIC7702X hangs when disabling unused D2D/PVT gates Mervyn Pretorius
2026-11-23 7:11 ` Xuyang Dong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox