Linux clock framework development
 help / color / mirror / Atom feed
From: Taniya Das <quic_tdas@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Stephen Boyd <sboyd@kernel.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Rob Herring <robh@kernel.org>, <linux-arm-msm@vger.kernel.org>,
	<linux-clk@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Kalpak Kawadkar <quic_kkawadka@quicinc.com>
Subject: Re: [PATCH 06/14] clk: qcom: clk-branch: Add support for BRANCH_HALT_POLL flag
Date: Fri, 18 Oct 2024 16:32:47 +0530	[thread overview]
Message-ID: <dfafb945-69f7-4378-9bb0-72eee37de235@quicinc.com> (raw)
In-Reply-To: <jcjncf5k5syvcvwxoopksisjvvmw4cvxo35nieqf63mquj57io@fumh4jnh2e4p>



On 10/18/2024 3:35 AM, Dmitry Baryshkov wrote:
> On Thu, Oct 17, 2024 at 11:03:20AM -0700, Stephen Boyd wrote:
>> Quoting Dmitry Baryshkov (2024-10-17 09:56:56)
>>> From: Kalpak Kawadkar <quic_kkawadka@quicinc.com>
>>>
>>> On some platforms branch clock will be enabled before Linux.
>>> It is expectated from the clock provider is to poll on the clock
>>
>> Unfortunately 'expectated' is not a word. The sentence is also
>> grammatically incorrect.
>>
>>> to ensure it is indeed enabled and not HW gated, thus add
>>> the BRANCH_HALT_POLL flag.
>> [...]
>>> diff --git a/drivers/clk/qcom/clk-branch.c b/drivers/clk/qcom/clk-branch.c
>>> index 229480c5b075a0e70dc05b1cb15b88d29fd475ce..c4c7bd565cc9a3926e24bb12ed6355ec6ddd19fb 100644
>>> --- a/drivers/clk/qcom/clk-branch.c
>>> +++ b/drivers/clk/qcom/clk-branch.c
>>> @@ -76,6 +76,7 @@ static int clk_branch_wait(const struct clk_branch *br, bool enabling,
>>>                  udelay(10);
>>>          } else if (br->halt_check == BRANCH_HALT_ENABLE ||
>>>                     br->halt_check == BRANCH_HALT ||
>>> +                  br->halt_check == BRANCH_HALT_POLL ||
>>
>> The name is confusing. The halt check is already "polling", i.e. this
>> isn't a different type of halt check. This is really something like
>> another branch flag that doesn't have to do with the halt checking and
>> only to do with skipping writing the enable bit. Maybe we should
>> introduce another clk_ops for these types of clks instead.
> 
> SGTM. All clocks with this flag use clk_branch2_aon_ops, so it is easy
> to switch to a separate clk_ops.
> 

The basic requirement here is to just poll in both enable/disable, but 
HLOS cannot update the CLK_ENABLE bit. The clock could be gated by the 
bandwidth vote and thus to ensure the clock is in good state before the 
consumers start using the subsystem.

We can definitely think for a different ops, I think it is better we 
have a good name to the flag.

>>
>>>                     (enabling && voted)) {
>>>                  int count = 200;
>>>   
>>> @@ -97,6 +98,10 @@ static int clk_branch_toggle(struct clk_hw *hw, bool en,
>>>          struct clk_branch *br = to_clk_branch(hw);
>>>          int ret;
>>>   
>>> +       if (br->halt_check == BRANCH_HALT_POLL) {
>>
>> Remove braces
>>
>>> +               return  clk_branch_wait(br, en, check_halt);
>>
>> Remove extra space      ^
>>
>>> +       }
>>> +
> 

-- 
Thanks & Regards,
Taniya Das.

  reply	other threads:[~2024-10-18 11:03 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-17 16:56 [PATCH 00/14] clk: qcom: add support for clock controllers on the SAR2130P platform Dmitry Baryshkov
2024-10-17 16:56 ` [PATCH 01/14] dt-bindings: clock: qcom,rpmhcc: Add SAR2130P compatible Dmitry Baryshkov
2024-10-21  7:51   ` Krzysztof Kozlowski
2024-10-17 16:56 ` [PATCH 02/14] dt-bindings: clock: qcom: document SAR2130P Global Clock Controller Dmitry Baryshkov
2024-10-18  6:50   ` Krzysztof Kozlowski
2024-10-17 16:56 ` [PATCH 03/14] dt-bindings: clock: qcom,sm8550-tcsr: Add SAR2130P compatible Dmitry Baryshkov
2024-10-18  7:09   ` Krzysztof Kozlowski
2024-10-17 16:56 ` [PATCH 04/14] dt-bindings: clock: qcom,sm8550-dispcc: " Dmitry Baryshkov
2024-10-21  7:52   ` Krzysztof Kozlowski
2024-10-17 16:56 ` [PATCH 05/14] dt-bindings: clk: qcom,sm8450-gpucc: add SAR2130P compatibles Dmitry Baryshkov
2024-10-18  6:51   ` Krzysztof Kozlowski
2024-10-18  7:10   ` Krzysztof Kozlowski
2024-10-18  8:34     ` Dmitry Baryshkov
2024-10-17 16:56 ` [PATCH 06/14] clk: qcom: clk-branch: Add support for BRANCH_HALT_POLL flag Dmitry Baryshkov
2024-10-17 18:03   ` Stephen Boyd
2024-10-17 22:05     ` Dmitry Baryshkov
2024-10-18 11:02       ` Taniya Das [this message]
2024-10-18 11:12         ` Dmitry Baryshkov
2024-10-17 16:56 ` [PATCH 07/14] clk: qcom: clk-branch: Add support for SREG branch ops Dmitry Baryshkov
2024-10-17 18:10   ` Stephen Boyd
2024-10-17 22:00     ` Dmitry Baryshkov
2024-10-17 22:28       ` Stephen Boyd
2024-10-18  9:56         ` Dmitry Baryshkov
2024-10-18 10:50           ` Taniya Das
2024-10-18 10:53             ` Dmitry Baryshkov
2024-10-17 16:56 ` [PATCH 08/14] clk: qcom: rcg2: add clk_rcg2_shared_floor_ops Dmitry Baryshkov
2024-10-17 16:56 ` [PATCH 09/14] clk: qcom: gdsc: add separate sleep state collapse vote support Dmitry Baryshkov
2024-10-18 10:28   ` Taniya Das
2024-10-18 10:48     ` Dmitry Baryshkov
2024-10-17 16:57 ` [PATCH 10/14] clk: qcom: rpmh: add support for SAR2130P Dmitry Baryshkov
2024-10-17 19:11   ` Konrad Dybcio
2024-10-17 16:57 ` [PATCH 11/14] clk: qcom: add support for GCC on SAR2130P Dmitry Baryshkov
2024-10-20 23:30   ` kernel test robot
2024-10-20 23:52   ` kernel test robot
2024-10-17 16:57 ` [PATCH 12/14] clk: qcom: tcsrcc-sm8550: add SAR2130P support Dmitry Baryshkov
2024-10-17 19:13   ` Konrad Dybcio
2024-10-17 16:57 ` [PATCH 13/14] clk: qcom: dispcc-sm8550: enable support for SAR2130P Dmitry Baryshkov
2024-10-18  7:26   ` Neil Armstrong
2024-10-17 16:57 ` [PATCH 14/14] clk: qcom: add SAR2130P GPU Clock Controller support Dmitry Baryshkov
2024-10-17 19:21   ` Konrad Dybcio

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=dfafb945-69f7-4378-9bb0-72eee37de235@quicinc.com \
    --to=quic_tdas@quicinc.com \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.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=neil.armstrong@linaro.org \
    --cc=p.zabel@pengutronix.de \
    --cc=quic_kkawadka@quicinc.com \
    --cc=robh@kernel.org \
    --cc=sboyd@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