* [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
2026-07-06 20:07 ` (subset) [PATCH 0/2] clk: spacemit: k3: set few clocks " Yixun Lan
2 siblings, 1 reply; 5+ 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 [flat|nested] 5+ 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; 5+ 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] 5+ 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
2026-07-06 20:07 ` (subset) [PATCH 0/2] clk: spacemit: k3: set few clocks " Yixun Lan
2 siblings, 0 replies; 5+ 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 [flat|nested] 5+ messages in thread* Re: (subset) [PATCH 0/2] clk: spacemit: k3: set few clocks 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 ` [PATCH 2/2] clk: spacemit: k3: set rcpu " Yixun Lan
@ 2026-07-06 20:07 ` Yixun Lan
2 siblings, 0 replies; 5+ messages in thread
From: Yixun Lan @ 2026-07-06 20:07 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Brian Masney, Yixun Lan
Cc: Han Gao, Vivian Wang, Drew Fustini, linux-clk, linux-riscv,
spacemit, linux-kernel
On Tue, 30 Jun 2026 08:53:18 +0000, Yixun Lan wrote:
> 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.
>
> [...]
Applied, thanks! Queued in for-clk-fixes-v7.2 branch
(Pick only patch 1/2, while leaving 2/2 for now)
[1/2] clk: spacemit: k3: set hdma clock as critical
https://git.kernel.org/pub/scm/linux/kernel/git/spacemit/linux.git/commit/?id=eb525edd48907795c0d4e498ff57ad168070b289
Best regards,
--
Yixun Lan <dlan@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread