The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/2] clk: spacemit: k3: set few clocks as critical
@ 2026-06-30  8:53 Yixun Lan
  2026-06-30  8:53 ` [PATCH 1/2] clk: spacemit: k3: set hdma clock " Yixun Lan
  2026-06-30  8:53 ` [PATCH 2/2] clk: spacemit: k3: set rcpu " Yixun Lan
  0 siblings, 2 replies; 4+ messages in thread
From: Yixun Lan @ 2026-06-30  8:53 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Brian Masney
  Cc: Han Gao, Vivian Wang, Drew Fustini, linux-clk, linux-riscv,
	spacemit, linux-kernel, Yixun Lan

Some clocks in K3 SoC need to set the critical flag so it will never
get these clocks closed.
  The HDMA clock provides the clock source for internal TCM access path
of X100 RISC-V core, and from the real test case, shut down this clock
will cause whole Linux system hang in a quite minimal environment with
only ethernet, UFS modules enabled.
  The RCPU clock is needed for RCPUs which are two RT24 RISC-V cores and
it's responisble for running ESOS instance. ESOS should be always kept
running behind Linux, so set it as critical flag to prevent it from being
shut off.

  This issue was reported-by Han Gao off line, and I didn't discover this
due to 'clk_ignore_unused' kernel flag was enabled.

Signed-off-by: Yixun Lan <dlan@kernel.org>
---
Yixun Lan (2):
      clk: spacemit: k3: set hdma clock as critical
      clk: spacemit: k3: set rcpu clock as critical

 drivers/clk/spacemit/ccu-k3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260611-06-clk-hdma-critial-4b56abb70691

Best regards,
--  
Yixun Lan <dlan@kernel.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] clk: spacemit: k3: set hdma clock as critical
  2026-06-30  8:53 [PATCH 0/2] clk: spacemit: k3: set few clocks as critical Yixun Lan
@ 2026-06-30  8:53 ` Yixun Lan
  2026-06-30 22:50   ` Aurelien Jarno
  2026-06-30  8:53 ` [PATCH 2/2] clk: spacemit: k3: set rcpu " Yixun Lan
  1 sibling, 1 reply; 4+ messages in thread
From: Yixun Lan @ 2026-06-30  8:53 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Brian Masney
  Cc: Han Gao, Vivian Wang, Drew Fustini, linux-clk, linux-riscv,
	spacemit, linux-kernel, Yixun Lan

HDMA clock is responsible for the internal TCM access path of X100 RISC-V
core, so set the clock flag as critical to prevent it from being shut off,
otherwise the Linux system will hang.

Fixes: e371a77255b8 ("clk: spacemit: k3: add the clock tree")
Reported-by: Han Gao <gaohan@iscas.ac.cn>
Signed-off-by: Yixun Lan <dlan@kernel.org>
---
 drivers/clk/spacemit/ccu-k3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/spacemit/ccu-k3.c b/drivers/clk/spacemit/ccu-k3.c
index cb0c4277f72a..f0160b4c0e1b 100644
--- a/drivers/clk/spacemit/ccu-k3.c
+++ b/drivers/clk/spacemit/ccu-k3.c
@@ -1026,7 +1026,7 @@ CCU_MUX_DIV_GATE_DEFINE(isim_vclk_out3, isim_vclk_parents, APMU_SNR_ISIM_VCLK_CT
 /* APMU clocks end */
 
 /* DCIU clocks start */
-CCU_GATE_DEFINE(hdma_clk, CCU_PARENT_HW(axi_clk), DCIU_DMASYS_CLK_EN, BIT(0), 0);
+CCU_GATE_DEFINE(hdma_clk, CCU_PARENT_HW(axi_clk), DCIU_DMASYS_CLK_EN, BIT(0), CLK_IS_CRITICAL);
 CCU_GATE_DEFINE(dma350_clk, CCU_PARENT_HW(axi_clk), DCIU_DMASYS_SDMA_CLK_EN, BIT(0), 0);
 CCU_GATE_DEFINE(c2_tcm_pipe_clk, CCU_PARENT_HW(axi_clk), DCIU_C2_TCM_PIPE_CLK, BIT(0), 0);
 CCU_GATE_DEFINE(c3_tcm_pipe_clk, CCU_PARENT_HW(axi_clk), DCIU_C3_TCM_PIPE_CLK, BIT(0), 0);

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] clk: spacemit: k3: set rcpu clock as critical
  2026-06-30  8:53 [PATCH 0/2] clk: spacemit: k3: set few clocks as critical Yixun Lan
  2026-06-30  8:53 ` [PATCH 1/2] clk: spacemit: k3: set hdma clock " Yixun Lan
@ 2026-06-30  8:53 ` Yixun Lan
  1 sibling, 0 replies; 4+ messages in thread
From: Yixun Lan @ 2026-06-30  8:53 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Brian Masney
  Cc: Han Gao, Vivian Wang, Drew Fustini, linux-clk, linux-riscv,
	spacemit, linux-kernel, Yixun Lan

The SpacemiT K3 SoC integrates two RT24 RISC-V little cores (os0_rcpu and
os1_rcpu), each running an independent ESOS instance responsible for
system power management and real-time task. The RCPU clock is required
in order to keep these cores functional, so set its clock as critical to
prevent it from being shut off.

Fixes: e371a77255b8 ("clk: spacemit: k3: add the clock tree")
Reported-by: Han Gao <gaohan@iscas.ac.cn>
Signed-off-by: Yixun Lan <dlan@kernel.org>
---
 drivers/clk/spacemit/ccu-k3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/spacemit/ccu-k3.c b/drivers/clk/spacemit/ccu-k3.c
index f0160b4c0e1b..3867d2cff2f9 100644
--- a/drivers/clk/spacemit/ccu-k3.c
+++ b/drivers/clk/spacemit/ccu-k3.c
@@ -866,7 +866,7 @@ static const struct clk_parent_data rcpu_clk_parents[] = {
 	CCU_PARENT_HW(pll1_d6_409p6),
 };
 CCU_MUX_DIV_GATE_FC_DEFINE(rcpu_clk, rcpu_clk_parents, APMU_RCPU_CLK_RES_CTRL,
-			   4, 3, BIT(15), 7, 3, BIT(12), 0);
+			   4, 3, BIT(15), 7, 3, BIT(12), CLK_IS_CRITICAL);
 
 static const struct clk_parent_data dsi4ln2_dsi_esc_parents[] = {
 	CCU_PARENT_HW(pll1_d48_51p2_ap),

-- 
2.54.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] clk: spacemit: k3: set hdma clock as critical
  2026-06-30  8:53 ` [PATCH 1/2] clk: spacemit: k3: set hdma clock " Yixun Lan
@ 2026-06-30 22:50   ` Aurelien Jarno
  0 siblings, 0 replies; 4+ messages in thread
From: Aurelien Jarno @ 2026-06-30 22:50 UTC (permalink / raw)
  To: Yixun Lan
  Cc: Michael Turquette, Stephen Boyd, Brian Masney, Han Gao,
	Vivian Wang, Drew Fustini, linux-clk, linux-riscv, spacemit,
	linux-kernel

On 2026-06-30 08:53, Yixun Lan wrote:
> HDMA clock is responsible for the internal TCM access path of X100 RISC-V
> core, so set the clock flag as critical to prevent it from being shut off,
> otherwise the Linux system will hang.
> 
> Fixes: e371a77255b8 ("clk: spacemit: k3: add the clock tree")
> Reported-by: Han Gao <gaohan@iscas.ac.cn>
> Signed-off-by: Yixun Lan <dlan@kernel.org>
> ---
>  drivers/clk/spacemit/ccu-k3.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/spacemit/ccu-k3.c b/drivers/clk/spacemit/ccu-k3.c
> index cb0c4277f72a..f0160b4c0e1b 100644
> --- a/drivers/clk/spacemit/ccu-k3.c
> +++ b/drivers/clk/spacemit/ccu-k3.c
> @@ -1026,7 +1026,7 @@ CCU_MUX_DIV_GATE_DEFINE(isim_vclk_out3, isim_vclk_parents, APMU_SNR_ISIM_VCLK_CT
>  /* APMU clocks end */
>  
>  /* DCIU clocks start */
> -CCU_GATE_DEFINE(hdma_clk, CCU_PARENT_HW(axi_clk), DCIU_DMASYS_CLK_EN, BIT(0), 0);
> +CCU_GATE_DEFINE(hdma_clk, CCU_PARENT_HW(axi_clk), DCIU_DMASYS_CLK_EN, BIT(0), CLK_IS_CRITICAL);
>  CCU_GATE_DEFINE(dma350_clk, CCU_PARENT_HW(axi_clk), DCIU_DMASYS_SDMA_CLK_EN, BIT(0), 0);
>  CCU_GATE_DEFINE(c2_tcm_pipe_clk, CCU_PARENT_HW(axi_clk), DCIU_C2_TCM_PIPE_CLK, BIT(0), 0);
>  CCU_GATE_DEFINE(c3_tcm_pipe_clk, CCU_PARENT_HW(axi_clk), DCIU_C3_TCM_PIPE_CLK, BIT(0), 0);

Thanks for the patch. It fixes a system hang occuring when a vector 
instruction access generates a page fault.

Tested-by: Aurelien Jarno <aurelien@aurel32.net>

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                     http://aurel32.net

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-30 22:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30  8:53 [PATCH 0/2] clk: spacemit: k3: set few clocks as critical Yixun Lan
2026-06-30  8:53 ` [PATCH 1/2] clk: spacemit: k3: set hdma clock " Yixun Lan
2026-06-30 22:50   ` Aurelien Jarno
2026-06-30  8:53 ` [PATCH 2/2] clk: spacemit: k3: set rcpu " Yixun Lan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox