Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Xuyang Dong" <dongxuyang@eswincomputing.com>
To: "Mervyn Pretorius" <mervynpretorius.oss@gmail.com>,
	"Pinkesh Vaghela" <pinkesh.vaghela@einfochips.com>
Cc: "Yifeng Huang" <huangyifeng@eswincomputing.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Brian Masney" <bmasney+clk@redhat.com>,
	"Jerome Brunet" <jbrunet+clk@baylibre.com>,
	linux-clk@vger.kernel.org, linux-riscv@lists.infradead.org,
	"Min Lin" <linmin@eswincomputing.com>,
	"Pritesh Patel" <pritesh.patel@einfochips.com>,
	"Xuyang Dong" <dongxuyang@eswincomputing.com>
Subject: Re: clk: eswin: eic7700: EIC7702X hangs when disabling unused D2D/PVT gates
Date: Mon, 23 Nov 2026 15:11:08 +0800 (GMT+08:00)	[thread overview]
Message-ID: <5808e2e6.c22.1a2073e88d2.Coremail.dongxuyang@eswincomputing.com> (raw)
In-Reply-To: <20261122191830.2183513-1-mervynpretorius.oss@gmail.com>

> 
> 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
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

      reply	other threads:[~2026-11-23  7:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=5808e2e6.c22.1a2073e88d2.Coremail.dongxuyang@eswincomputing.com \
    --to=dongxuyang@eswincomputing.com \
    --cc=bmasney+clk@redhat.com \
    --cc=huangyifeng@eswincomputing.com \
    --cc=jbrunet+clk@baylibre.com \
    --cc=linmin@eswincomputing.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mervynpretorius.oss@gmail.com \
    --cc=pinkesh.vaghela@einfochips.com \
    --cc=pritesh.patel@einfochips.com \
    --cc=sboyd@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