From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Bjorn Andersson <andersson@kernel.org>
Cc: Andy Gross <agross@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
devicetree@vger.kernel.org, Shawn Guo <shawn.guo@linaro.org>
Subject: Re: [PATCH RFT v2 02/14] clk: qcom: smd-rpm: Add .is_enabled hook
Date: Thu, 6 Apr 2023 16:43:55 +0200 [thread overview]
Message-ID: <fed27bde-f7c7-fae2-de6f-a997587b93b1@linaro.org> (raw)
In-Reply-To: <20230322030218.7xjrsgt3abqft2y7@ripper>
On 22.03.2023 04:02, Bjorn Andersson wrote:
> On Wed, Mar 08, 2023 at 10:35:18PM +0100, Konrad Dybcio wrote:
>> From: Shawn Guo <shawn.guo@linaro.org>
>>
>> The RPM clock enabling state can be found with 'enabled' in struct
>> clk_smd_rpm. Add .is_enabled hook so that clk_summary in debugfs can
>> show a correct enabling state for RPM clocks.
>>
>
> I don't think .is_enabled should be implemented for clocks where the
> actual state can't be queried.
>
> E.g. should a clock which is is_enabled = false be unprepared during
> disable_unused? It's already disabled...
That's true, it sounds silly.
However, I feel like it's the least painful option, as trying to disable
a clock that's already actually disabled (read, in hw+RPM, not Linux)
will not do any harm.
Not adding this (and by extension not making use of any sort of unused
clk cleanup) will prevent the system from hitting low power modes and
SMD RPM is strictly speaking, too dumb to figure out that these clocks
aren't really consumed.
Konrad
>
> Regards,
> Bjorn
>
>> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
>> [Konrad: rebase]
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>> drivers/clk/qcom/clk-smd-rpm.c | 9 +++++++++
>> 1 file changed, 9 insertions(+)
>>
>> diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c
>> index 198886c1b6c8..ecacfbc4a16c 100644
>> --- a/drivers/clk/qcom/clk-smd-rpm.c
>> +++ b/drivers/clk/qcom/clk-smd-rpm.c
>> @@ -424,18 +424,27 @@ static int clk_smd_rpm_enable_scaling(struct qcom_smd_rpm *rpm)
>> return 0;
>> }
>>
>> +static int clk_smd_rpm_is_enabled(struct clk_hw *hw)
>> +{
>> + struct clk_smd_rpm *r = to_clk_smd_rpm(hw);
>> +
>> + return r->enabled;
>> +}
>> +
>> static const struct clk_ops clk_smd_rpm_ops = {
>> .prepare = clk_smd_rpm_prepare,
>> .unprepare = clk_smd_rpm_unprepare,
>> .set_rate = clk_smd_rpm_set_rate,
>> .round_rate = clk_smd_rpm_round_rate,
>> .recalc_rate = clk_smd_rpm_recalc_rate,
>> + .is_enabled = clk_smd_rpm_is_enabled,
>> };
>>
>> static const struct clk_ops clk_smd_rpm_branch_ops = {
>> .prepare = clk_smd_rpm_prepare,
>> .unprepare = clk_smd_rpm_unprepare,
>> .recalc_rate = clk_smd_rpm_recalc_rate,
>> + .is_enabled = clk_smd_rpm_is_enabled,
>> };
>>
>> DEFINE_CLK_SMD_RPM_BRANCH_A(bi_tcxo, QCOM_SMD_RPM_MISC_CLK, 0, 19200000);
>>
>> --
>> 2.39.2
>>
next prev parent reply other threads:[~2023-04-06 14:45 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-08 21:35 [PATCH RFT v2 00/14] SMD RPMCC sleep preparations Konrad Dybcio
2023-03-08 21:35 ` [PATCH RFT v2 01/14] dt-bindings: clock: qcom,rpmcc: Add a way to enable unused clock cleanup Konrad Dybcio
2023-03-16 22:58 ` Rob Herring
2023-03-17 0:31 ` Konrad Dybcio
2023-03-17 18:20 ` Stephen Boyd
2023-04-06 14:44 ` Konrad Dybcio
2023-04-07 20:17 ` Konrad Dybcio
2023-04-11 21:34 ` Konrad Dybcio
2023-03-22 3:23 ` Bjorn Andersson
2023-04-17 19:05 ` Stephan Gerhold
2023-04-18 0:19 ` Stephen Boyd
2023-04-18 10:33 ` Konrad Dybcio
2023-04-19 11:31 ` Konrad Dybcio
2023-04-19 14:00 ` Stephan Gerhold
2023-04-19 21:08 ` Konrad Dybcio
2023-04-20 8:28 ` Manivannan Sadhasivam
2023-03-08 21:35 ` [PATCH RFT v2 02/14] clk: qcom: smd-rpm: Add .is_enabled hook Konrad Dybcio
2023-03-09 0:47 ` Dmitry Baryshkov
2023-03-22 3:02 ` Bjorn Andersson
2023-04-06 14:43 ` Konrad Dybcio [this message]
2023-03-08 21:35 ` [PATCH RFT v2 03/14] clk: qcom: smd-rpm: Add .is_prepared hook Konrad Dybcio
2023-03-09 0:48 ` Dmitry Baryshkov
2023-03-08 21:35 ` [PATCH RFT v2 04/14] clk: qcom: smd-rpm_ Make __DEFINE_CLK_SMD_RPM_BRANCH_PREFIX accept flags Konrad Dybcio
2023-03-09 0:48 ` Dmitry Baryshkov
2023-03-08 21:35 ` [PATCH RFT v2 05/14] clk: qcom: smd-rpm: Make DEFINE_CLK_SMD_RPM_BRANCH_A " Konrad Dybcio
2023-03-09 0:49 ` Dmitry Baryshkov
2023-03-08 21:35 ` [PATCH RFT v2 06/14] clk: qcom: smd-rpm: Make BI_TCXO_AO critical Konrad Dybcio
2023-03-09 0:49 ` Dmitry Baryshkov
2023-03-08 21:35 ` [PATCH RFT v2 07/14] clk: qcom: smd-rpm: Make __DEFINE_CLK_SMD_RPM_PREFIX accept flags Konrad Dybcio
2023-03-09 0:50 ` Dmitry Baryshkov
2023-03-08 21:35 ` [PATCH RFT v2 08/14] clk: qcom: smd-rpm: Separate out a macro for defining an AO clock Konrad Dybcio
2023-03-09 0:50 ` Dmitry Baryshkov
2023-03-08 21:35 ` [PATCH RFT v2 09/14] clk: qcom: smd-rpm: Add support for keepalive votes Konrad Dybcio
2023-03-09 0:54 ` Dmitry Baryshkov
2023-03-09 1:22 ` Konrad Dybcio
2023-03-08 21:35 ` [PATCH RFT v2 10/14] clk: qcom: smd-rpm: Introduce DEFINE_CLK_SMD_RPM_BUS_KEEPALIVE Konrad Dybcio
2023-03-09 1:25 ` Dmitry Baryshkov
2023-03-08 21:35 ` [PATCH RFT v2 11/14] clk: qcom: smd-rpm: Hook up PCNoC_0 keep_alive Konrad Dybcio
2023-03-09 1:25 ` Dmitry Baryshkov
2023-03-22 3:19 ` Bjorn Andersson
2023-03-22 8:05 ` Konrad Dybcio
2023-03-08 21:35 ` [PATCH RFT v2 12/14] clk: qcom: smd-rpm: Hook up CNoC_1 and SNoC_2 keep_alive Konrad Dybcio
2023-03-09 1:25 ` Dmitry Baryshkov
2023-03-08 21:35 ` [PATCH RFT v2 13/14] clk: qcom: smd-rpm: Mark clock enabled in clk_smd_rpm_handoff() Konrad Dybcio
2023-03-08 21:35 ` [PATCH RFT v2 14/14] arm64: dts: qcom: msm8996: Enable rpmcc unused clk disablement Konrad Dybcio
2023-04-20 1:50 ` [PATCH RFT v2 00/14] SMD RPMCC sleep preparations Konrad Dybcio
2023-04-20 7:56 ` Stephan Gerhold
2023-04-20 9:36 ` Konrad Dybcio
2023-04-20 10:04 ` Stephan Gerhold
2023-04-20 10:20 ` Konrad Dybcio
2023-04-20 15:57 ` Konrad Dybcio
2023-04-25 19:35 ` Stephen Boyd
2023-04-26 9:40 ` 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=fed27bde-f7c7-fae2-de6f-a997587b93b1@linaro.org \
--to=konrad.dybcio@linaro.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@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=robh+dt@kernel.org \
--cc=sboyd@kernel.org \
--cc=shawn.guo@linaro.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;
as well as URLs for NNTP newsgroup(s).