From: Stephen Boyd <sboyd@kernel.org>
To: Danila Tikhonov <danila@jiaxyga.com>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
agross@kernel.org, andersson@kernel.org, dkatraga@codeaurora.org,
mturquette@baylibre.com, quic_tdas@quicinc.com, vkoul@kernel.org
Cc: adomerlee@gmail.com, linux-arm-msm@vger.kernel.org,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src
Date: Thu, 28 Sep 2023 16:53:19 -0700 [thread overview]
Message-ID: <be6ec178bec389ee9094dc62692b7b07.sboyd@kernel.org> (raw)
In-Reply-To: <b6ded7b6-1818-402f-8826-2ab1ecd05056@linaro.org>
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?
next prev parent reply other threads:[~2023-09-28 23:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2023-09-20 17:13 ` Bjorn Andersson
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=be6ec178bec389ee9094dc62692b7b07.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=adomerlee@gmail.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=danila@jiaxyga.com \
--cc=dkatraga@codeaurora.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=quic_tdas@quicinc.com \
--cc=vkoul@kernel.org \
/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