Linux clock framework development
 help / color / mirror / Atom feed
From: Brian Masney <bmasney@redhat.com>
To: Jagadeesh Kona <jagadeesh.kona@oss.qualcomm.com>
Cc: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Taniya Das <taniya.das@oss.qualcomm.com>
Subject: Re: [PATCH] clk: qcom: enable ALWAYS_ON for titan_top_gdsc
Date: Wed, 1 Jul 2026 10:09:08 -0400	[thread overview]
Message-ID: <akUfhLO0I2NqqIYi@redhat.com> (raw)
In-Reply-To: <56ebd97b-0834-41ac-8fdb-2469e2848694@oss.qualcomm.com>

Hi Jagadeesh,

On Wed, Jul 01, 2026 at 09:37:04AM +0530, Jagadeesh Kona wrote:
> This probably could be due to camcc_gdsc_clk getting turned OFF during the
> sync_state, but this clk is required for GDSC transitions. The camcc_gdsc_clk
> is currently kept always ON from probe in camcc-sc8280xp, but the clock is
> also modeled with clock framework, so the clock can get disabled in sync_state
> callback now.
> 
> Can you please try removing the modelling of camcc_gdsc_clk using below diff
> and see if helps here?
> 
> 
> diff --git a/drivers/clk/qcom/camcc-sc8280xp.c b/drivers/clk/qcom/camcc-sc8280xp.c
> index e97b8d4f3c84..660d8655d391 100644
> --- a/drivers/clk/qcom/camcc-sc8280xp.c
> +++ b/drivers/clk/qcom/camcc-sc8280xp.c
> @@ -1753,24 +1753,6 @@ static struct clk_branch camcc_csiphy3_clk = {
>         },
>  };
> 
> -static struct clk_branch camcc_gdsc_clk = {
> -       .halt_reg = 0xc1e4,
> -       .halt_check = BRANCH_HALT,
> -       .clkr = {
> -               .enable_reg = 0xc1e4,
> -               .enable_mask = BIT(0),
> -               .hw.init = &(struct clk_init_data){
> -                       .name = "camcc_gdsc_clk",
> -                       .parent_hws = (const struct clk_hw*[]){
> -                               &camcc_xo_clk_src.clkr.hw,
> -                       },
> -                       .num_parents = 1,
> -                       .flags = CLK_SET_RATE_PARENT,
> -                       .ops = &clk_branch2_ops,
> -               },
> -       },
> -};
> -
>  static struct clk_branch camcc_icp_ahb_clk = {
>         .halt_reg = 0xc0d8,
>         .halt_check = BRANCH_HALT,
> @@ -2839,7 +2821,6 @@ static struct clk_regmap *camcc_sc8280xp_clocks[] = {
>         [CAMCC_CSIPHY2_CLK] = &camcc_csiphy2_clk.clkr,
>         [CAMCC_CSIPHY3_CLK] = &camcc_csiphy3_clk.clkr,
>         [CAMCC_FAST_AHB_CLK_SRC] = &camcc_fast_ahb_clk_src.clkr,
> -       [CAMCC_GDSC_CLK] = &camcc_gdsc_clk.clkr,
>         [CAMCC_ICP_AHB_CLK] = &camcc_icp_ahb_clk.clkr,
>         [CAMCC_ICP_CLK] = &camcc_icp_clk.clkr,
>         [CAMCC_ICP_CLK_SRC] = &camcc_icp_clk_src.clkr,

So there is the CLK_IGNORE_UNUSED flag that can be added so that we can
keep the clock defined.

diff --git a/drivers/clk/qcom/camcc-sc8280xp.c b/drivers/clk/qcom/camcc-sc8280xp.c
index 18f5a3eb313e1..9a525347fb2a4 100644
--- a/drivers/clk/qcom/camcc-sc8280xp.c
+++ b/drivers/clk/qcom/camcc-sc8280xp.c
@@ -1766,7 +1766,7 @@ static struct clk_branch camcc_gdsc_clk = {
                                &camcc_xo_clk_src.clkr.hw,
                        },
                        .num_parents = 1,
-                       .flags = CLK_SET_RATE_PARENT,
+                       .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
                        .ops = &clk_branch2_ops,
                },
        },

This patch fixes the issue for me. I see that camcc_sc8280xp_probe()
has this:

        /* Keep some clocks always-on */
        qcom_branch_set_clk_en(regmap, 0xc1e4); /* CAMCC_GDSC_CLK */

I'll submit a proper patch for this shortly.

Do you by chance work on the team that deals with clocks at Qualcomm? If
so, it would be really nice if your team could make the time to help
review a patch set that I have to fix some scaling issues with clocks.
Here's some details:

https://lore.kernel.org/linux-clk/akPcgdjlDxd-JmYb@redhat.com/

This is two messages up in the same thread that has an example kunit
test snippet showing the problem:
https://lore.kernel.org/linux-clk/CABx5tqK3MymYQZ4owofnzFLnjt+96njw5RG2Vwxo7UJ93A-42g@mail.gmail.com/

Thanks,

Brian


  reply	other threads:[~2026-07-01 14:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26 16:26 [PATCH] clk: qcom: enable ALWAYS_ON for titan_top_gdsc Brian Masney
2026-06-26 16:32 ` Konrad Dybcio
2026-06-26 16:54   ` Vladimir Zapolskiy
2026-06-29 11:03     ` Brian Masney
2026-06-29 13:00       ` Vladimir Zapolskiy
2026-06-29 15:27         ` Brian Masney
2026-06-29 16:29           ` Vladimir Zapolskiy
2026-07-01  4:07   ` Jagadeesh Kona
2026-07-01 14:09     ` Brian Masney [this message]
2026-06-26 16:59 ` Vladimir Zapolskiy
2026-06-29 11:07   ` Brian Masney
2026-06-27  9:51 ` Bryan O'Donoghue
2026-06-29 11:01   ` Brian Masney

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=akUfhLO0I2NqqIYi@redhat.com \
    --to=bmasney@redhat.com \
    --cc=andersson@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=jagadeesh.kona@oss.qualcomm.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=taniya.das@oss.qualcomm.com \
    /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