public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src
@ 2023-09-13 17:56 Danila Tikhonov
  2023-09-13 18:02 ` Konrad Dybcio
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Danila Tikhonov @ 2023-09-13 17:56 UTC (permalink / raw)
  To: andersson, agross, konrad.dybcio, mturquette, sboyd, vkoul,
	quic_tdas, dkatraga
  Cc: danila, adomerlee, linux-arm-msm, linux-clk, linux-kernel

Set .flags = CLK_OPS_PARENT_ENABLE to fix "gcc_sdcc2_apps_clk_src: rcg
didn't update its configuration" error.

Fixes: 2a1d7eb854bb ("clk: qcom: gcc: Add global clock controller driver for SM8150")
Tested-by: Arseniy Velikanov <adomerlee@gmail.com>
Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
---
 drivers/clk/qcom/gcc-sm8150.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm8150.c
index 41ab210875fb..05d115c52dfe 100644
--- a/drivers/clk/qcom/gcc-sm8150.c
+++ b/drivers/clk/qcom/gcc-sm8150.c
@@ -774,7 +774,7 @@ static struct clk_rcg2 gcc_sdcc2_apps_clk_src = {
 		.name = "gcc_sdcc2_apps_clk_src",
 		.parent_data = gcc_parents_6,
 		.num_parents = ARRAY_SIZE(gcc_parents_6),
-		.flags = CLK_SET_RATE_PARENT,
+		.flags = CLK_OPS_PARENT_ENABLE,
 		.ops = &clk_rcg2_floor_ops,
 	},
 };
-- 
2.41.0


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

* Re: [PATCH] clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src
  2023-09-13 17:56 [PATCH] clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src Danila Tikhonov
@ 2023-09-13 18:02 ` Konrad Dybcio
  2023-09-14 16:20 ` Stephen Boyd
  2023-09-20 17:13 ` Bjorn Andersson
  2 siblings, 0 replies; 6+ messages in thread
From: Konrad Dybcio @ 2023-09-13 18:02 UTC (permalink / raw)
  To: Danila Tikhonov, andersson, agross, mturquette, sboyd, vkoul,
	quic_tdas, dkatraga
  Cc: adomerlee, linux-arm-msm, linux-clk, linux-kernel

On 13.09.2023 19:56, Danila Tikhonov wrote:
> Set .flags = CLK_OPS_PARENT_ENABLE to fix "gcc_sdcc2_apps_clk_src: rcg
> didn't update its configuration" error.
> 
> Fixes: 2a1d7eb854bb ("clk: qcom: gcc: Add global clock controller driver for SM8150")
> Tested-by: Arseniy Velikanov <adomerlee@gmail.com>
> Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
> ---
Would have been nice to mention this is necessary because
the source for the top frequency (GPLL9) is not enabled
by default

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

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

* Re: [PATCH] clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src
  2023-09-13 17:56 [PATCH] clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src Danila Tikhonov
  2023-09-13 18:02 ` Konrad Dybcio
@ 2023-09-14 16:20 ` Stephen Boyd
  2023-09-15 12:04   ` Konrad Dybcio
  2023-09-20 17:13 ` Bjorn Andersson
  2 siblings, 1 reply; 6+ messages in thread
From: Stephen Boyd @ 2023-09-14 16:20 UTC (permalink / raw)
  To: Danila Tikhonov, agross, andersson, dkatraga, konrad.dybcio,
	mturquette, quic_tdas, vkoul
  Cc: danila, adomerlee, linux-arm-msm, linux-clk, linux-kernel

Quoting Danila Tikhonov (2023-09-13 10:56:11)
> Set .flags = CLK_OPS_PARENT_ENABLE to fix "gcc_sdcc2_apps_clk_src: rcg
> didn't update its configuration" error.
> 
> Fixes: 2a1d7eb854bb ("clk: qcom: gcc: Add global clock controller driver for SM8150")
> Tested-by: Arseniy Velikanov <adomerlee@gmail.com>
> Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
> ---
>  drivers/clk/qcom/gcc-sm8150.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm8150.c
> index 41ab210875fb..05d115c52dfe 100644
> --- a/drivers/clk/qcom/gcc-sm8150.c
> +++ b/drivers/clk/qcom/gcc-sm8150.c
> @@ -774,7 +774,7 @@ static struct clk_rcg2 gcc_sdcc2_apps_clk_src = {
>                 .name = "gcc_sdcc2_apps_clk_src",
>                 .parent_data = gcc_parents_6,
>                 .num_parents = ARRAY_SIZE(gcc_parents_6),
> -               .flags = CLK_SET_RATE_PARENT,
> +               .flags = CLK_OPS_PARENT_ENABLE,
>                 .ops = &clk_rcg2_floor_ops,

In what case are we getting the rcg stuck? I thought that you could
write the rcg registers while the parent was off and switch to that
parent if the parent isn't enabled and it wouldn't get stuck.

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

* Re: [PATCH] clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src
  2023-09-14 16:20 ` Stephen Boyd
@ 2023-09-15 12:04   ` Konrad Dybcio
  2023-09-28 23:53     ` Stephen Boyd
  0 siblings, 1 reply; 6+ messages in thread
From: Konrad Dybcio @ 2023-09-15 12:04 UTC (permalink / raw)
  To: Stephen Boyd, Danila Tikhonov, agross, andersson, dkatraga,
	mturquette, quic_tdas, vkoul
  Cc: adomerlee, linux-arm-msm, linux-clk, linux-kernel

On 14.09.2023 18:20, Stephen Boyd wrote:
> Quoting Danila Tikhonov (2023-09-13 10:56:11)
>> Set .flags = CLK_OPS_PARENT_ENABLE to fix "gcc_sdcc2_apps_clk_src: rcg
>> didn't update its configuration" error.
>>
>> Fixes: 2a1d7eb854bb ("clk: qcom: gcc: Add global clock controller driver for SM8150")
>> Tested-by: Arseniy Velikanov <adomerlee@gmail.com>
>> Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
>> ---
>>  drivers/clk/qcom/gcc-sm8150.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm8150.c
>> index 41ab210875fb..05d115c52dfe 100644
>> --- a/drivers/clk/qcom/gcc-sm8150.c
>> +++ b/drivers/clk/qcom/gcc-sm8150.c
>> @@ -774,7 +774,7 @@ static struct clk_rcg2 gcc_sdcc2_apps_clk_src = {
>>                 .name = "gcc_sdcc2_apps_clk_src",
>>                 .parent_data = gcc_parents_6,
>>                 .num_parents = ARRAY_SIZE(gcc_parents_6),
>> -               .flags = CLK_SET_RATE_PARENT,
>> +               .flags = CLK_OPS_PARENT_ENABLE,
>>                 .ops = &clk_rcg2_floor_ops,
> 
> In what case are we getting the rcg stuck? I thought that you could
> write the rcg registers while the parent was off and switch to that
> parent if the parent isn't enabled and it wouldn't get stuck.
I think the better question here would be "why isn't
OPS_PARENT_ENABLE the default for all qc clocks on all
platforms" :/

Konrad

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

* Re: [PATCH] clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src
  2023-09-13 17:56 [PATCH] clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src Danila Tikhonov
  2023-09-13 18:02 ` Konrad Dybcio
  2023-09-14 16:20 ` Stephen Boyd
@ 2023-09-20 17:13 ` Bjorn Andersson
  2 siblings, 0 replies; 6+ messages in thread
From: Bjorn Andersson @ 2023-09-20 17:13 UTC (permalink / raw)
  To: agross, konrad.dybcio, mturquette, sboyd, vkoul, quic_tdas,
	dkatraga, Danila Tikhonov
  Cc: adomerlee, linux-arm-msm, linux-clk, linux-kernel


On Wed, 13 Sep 2023 20:56:11 +0300, Danila Tikhonov wrote:
> Set .flags = CLK_OPS_PARENT_ENABLE to fix "gcc_sdcc2_apps_clk_src: rcg
> didn't update its configuration" error.
> 
> 

Applied, thanks!

[1/1] clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src
      commit: 7138c244fb293f24ce8ab782961022eff00a10c4

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

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

* Re: [PATCH] clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src
  2023-09-15 12:04   ` Konrad Dybcio
@ 2023-09-28 23:53     ` Stephen Boyd
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2023-09-28 23:53 UTC (permalink / raw)
  To: Danila Tikhonov, Konrad Dybcio, agross, andersson, dkatraga,
	mturquette, quic_tdas, vkoul
  Cc: adomerlee, linux-arm-msm, linux-clk, linux-kernel

Quoting Konrad Dybcio (2023-09-15 05:04:41)
> On 14.09.2023 18:20, Stephen Boyd wrote:
> > Quoting Danila Tikhonov (2023-09-13 10:56:11)
> >> Set .flags = CLK_OPS_PARENT_ENABLE to fix "gcc_sdcc2_apps_clk_src: rcg
> >> didn't update its configuration" error.
> >>
> >> Fixes: 2a1d7eb854bb ("clk: qcom: gcc: Add global clock controller driver for SM8150")
> >> Tested-by: Arseniy Velikanov <adomerlee@gmail.com>
> >> Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
> >> ---
> >>  drivers/clk/qcom/gcc-sm8150.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/clk/qcom/gcc-sm8150.c b/drivers/clk/qcom/gcc-sm8150.c
> >> index 41ab210875fb..05d115c52dfe 100644
> >> --- a/drivers/clk/qcom/gcc-sm8150.c
> >> +++ b/drivers/clk/qcom/gcc-sm8150.c
> >> @@ -774,7 +774,7 @@ static struct clk_rcg2 gcc_sdcc2_apps_clk_src = {
> >>                 .name = "gcc_sdcc2_apps_clk_src",
> >>                 .parent_data = gcc_parents_6,
> >>                 .num_parents = ARRAY_SIZE(gcc_parents_6),
> >> -               .flags = CLK_SET_RATE_PARENT,
> >> +               .flags = CLK_OPS_PARENT_ENABLE,
> >>                 .ops = &clk_rcg2_floor_ops,
> > 
> > In what case are we getting the rcg stuck? I thought that you could
> > write the rcg registers while the parent was off and switch to that
> > parent if the parent isn't enabled and it wouldn't get stuck.
> I think the better question here would be "why isn't
> OPS_PARENT_ENABLE the default for all qc clocks on all
> platforms" :/
> 

We don't need that flag because of how the hardware works and how the
clk framework moves the enable of the parent from the old parent to the
new parent when changing rates. The RCGs only get stuck if we change the
parent of an RCG to a disabled parent when the current parent is enabled
and the RCG is enabled. Otherwise we're free to change the parent of the
RCG because it isn't trying to do a glitch free switch of clk frequency.

Is it possible that the clk is running out of boot on a parent that
is enabled in the hardware but doesn't look enabled to the clk framework
because of how we fail to hand off enable state? Maybe the mmc driver
then calls clk_set_rate() to change the rate (rcg is still off) and that
causes problems?

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

end of thread, other threads:[~2023-09-28 23:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-13 17:56 [PATCH] clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src Danila Tikhonov
2023-09-13 18:02 ` Konrad Dybcio
2023-09-14 16:20 ` Stephen Boyd
2023-09-15 12:04   ` Konrad Dybcio
2023-09-28 23:53     ` Stephen Boyd
2023-09-20 17:13 ` Bjorn Andersson

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