Linux clock framework development
 help / color / mirror / Atom feed
From: Mervyn Pretorius <mervynpretorius.oss@gmail.com>
To: Yifeng Huang <huangyifeng@eswincomputing.com>,
	Xuyang Dong <dongxuyang@eswincomputing.com>
Cc: 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>,
	Pinkesh Vaghela <pinkesh.vaghela@einfochips.com>,
	Pritesh Patel <pritesh.patel@einfochips.com>
Subject: clk: eswin: eic7700: EIC7702X hangs when disabling unused D2D/PVT gates
Date: Sun, 22 Nov 2026 19:18:30 +0000	[thread overview]
Message-ID: <20261122191830.2183513-1-mervynpretorius.oss@gmail.com> (raw)

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

             reply	other threads:[~2026-11-22 19:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 19:18 Mervyn Pretorius [this message]
2026-11-23  7:11 ` clk: eswin: eic7700: EIC7702X hangs when disabling unused D2D/PVT gates Xuyang Dong

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=20261122191830.2183513-1-mervynpretorius.oss@gmail.com \
    --to=mervynpretorius.oss@gmail.com \
    --cc=bmasney+clk@redhat.com \
    --cc=dongxuyang@eswincomputing.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=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