[PATCH 01/10] clk: qcom: gcc-msm8998: leave the GPU BIMC source and SNOC DVM clocks on

From: Dmitry Baryshkov

Date: Mon Oct 19 2026 - 09:44:52 EST


Booting MSM8998 without clk_ignore_unused resets the SoC shortly after
the unused clocks are turned off. Nothing references
gcc_gpu_bimc_gfx_src_clk, so it gets gated, and the SoC goes down
within a fraction of a second, with the GPU idle and with or without
Venus. Listing it as a GPU SMMU clock does not help: the SoC then
resets after the SMMU first runtime-suspends.

Downstream registered this clock and gcc_gpu_snoc_dvm_gfx_clk at
first, then dropped both because they need to be left at their default
ON state ("clk: msm: clock: Remove controlling some graphics clocks in
Linux"). SDM660 got the same treatment, and the upstream SDM660 driver
never registered them.

Do the same: stop registering both clocks and enable them at probe.

Fixes: b5f5f525c547 ("clk: qcom: Add MSM8998 Global Clock Control (GCC) driver")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>
---
drivers/clk/qcom/gcc-msm8998.c | 39 +++++++++++----------------------------
1 file changed, 11 insertions(+), 28 deletions(-)

diff --git a/drivers/clk/qcom/gcc-msm8998.c b/drivers/clk/qcom/gcc-msm8998.c
index c9701f7f6e18..97d4968c5bdd 100644
--- a/drivers/clk/qcom/gcc-msm8998.c
+++ b/drivers/clk/qcom/gcc-msm8998.c
@@ -2135,19 +2135,6 @@ static struct clk_branch gcc_gpu_bimc_gfx_clk = {
},
};

-static struct clk_branch gcc_gpu_bimc_gfx_src_clk = {
- .halt_reg = 0x7100c,
- .halt_check = BRANCH_HALT,
- .clkr = {
- .enable_reg = 0x7100c,
- .enable_mask = BIT(0),
- .hw.init = &(struct clk_init_data){
- .name = "gcc_gpu_bimc_gfx_src_clk",
- .ops = &clk_branch2_ops,
- },
- },
-};
-
static struct clk_branch gcc_gpu_cfg_ahb_clk = {
.halt_reg = 0x71004,
.halt_check = BRANCH_HALT_SKIP,
@@ -2167,19 +2154,6 @@ static struct clk_branch gcc_gpu_cfg_ahb_clk = {
},
};

-static struct clk_branch gcc_gpu_snoc_dvm_gfx_clk = {
- .halt_reg = 0x71018,
- .halt_check = BRANCH_HALT,
- .clkr = {
- .enable_reg = 0x71018,
- .enable_mask = BIT(0),
- .hw.init = &(struct clk_init_data){
- .name = "gcc_gpu_snoc_dvm_gfx_clk",
- .ops = &clk_branch2_ops,
- },
- },
-};
-
static struct clk_branch gcc_hmss_ahb_clk = {
.halt_reg = 0x48000,
.halt_check = BRANCH_HALT_VOTED,
@@ -3088,9 +3062,7 @@ static struct clk_regmap *gcc_msm8998_clocks[] = {
[GCC_GP3_CLK] = &gcc_gp3_clk.clkr,
[GCC_BIMC_GFX_CLK] = &gcc_bimc_gfx_clk.clkr,
[GCC_GPU_BIMC_GFX_CLK] = &gcc_gpu_bimc_gfx_clk.clkr,
- [GCC_GPU_BIMC_GFX_SRC_CLK] = &gcc_gpu_bimc_gfx_src_clk.clkr,
[GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr,
- [GCC_GPU_SNOC_DVM_GFX_CLK] = &gcc_gpu_snoc_dvm_gfx_clk.clkr,
[GCC_HMSS_AHB_CLK] = &gcc_hmss_ahb_clk.clkr,
[GCC_HMSS_AT_CLK] = &gcc_hmss_at_clk.clkr,
[GCC_HMSS_RBCPR_CLK] = &gcc_hmss_rbcpr_clk.clkr,
@@ -3323,6 +3295,16 @@ static const struct regmap_config gcc_msm8998_regmap_config = {
.fast_io = true,
};

+static const u32 gcc_msm8998_critical_cbcrs[] = {
+ 0x7100c, /* GCC_GPU_BIMC_GFX_SRC_CLK */
+ 0x71018, /* GCC_GPU_SNOC_DVM_GFX_CLK */
+};
+
+static const struct qcom_cc_driver_data gcc_msm8998_driver_data = {
+ .clk_cbcrs = gcc_msm8998_critical_cbcrs,
+ .num_clk_cbcrs = ARRAY_SIZE(gcc_msm8998_critical_cbcrs),
+};
+
static const struct qcom_cc_desc gcc_msm8998_desc = {
.config = &gcc_msm8998_regmap_config,
.clks = gcc_msm8998_clocks,
@@ -3331,6 +3313,7 @@ static const struct qcom_cc_desc gcc_msm8998_desc = {
.num_resets = ARRAY_SIZE(gcc_msm8998_resets),
.gdscs = gcc_msm8998_gdscs,
.num_gdscs = ARRAY_SIZE(gcc_msm8998_gdscs),
+ .driver_data = &gcc_msm8998_driver_data,
};

static int gcc_msm8998_probe(struct platform_device *pdev)

--
2.47.3