mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Stephan Gerhold <stephan@gerhold.net>
Cc: Stephen Boyd <sboyd@kernel.org>, Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	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
Subject: Re: [PATCH RFT v2 01/14] dt-bindings: clock: qcom,rpmcc: Add a way to enable unused clock cleanup
Date: Wed, 19 Apr 2023 23:08:01 +0200	[thread overview]
Message-ID: <6e55d3fa-744e-1f85-7642-6138f4e6e5a5@linaro.org> (raw)
In-Reply-To: <ZD_0AmYU-N5vzv8f@gerhold.net>



On 19.04.2023 16:00, Stephan Gerhold wrote:
> On Wed, Apr 19, 2023 at 01:31:01PM +0200, Konrad Dybcio wrote:
>> What should we do about the non-bus RPM clocks though? I don't fancy
>> IPA_CLK running 24/7.. And Stephan Gerhold was able to achieve VDD_MIN
>> on msm8909 with these clocks shut down (albeit with a very basic dt setup)!
>>
>> Taking into account the old interconnect-enabled DTs, some of the
>> clocks would need to be on so that the QoS writes can succeed
>> (e.g. the MAS_IPA endpoint needs IPA_CLK), it gets complicated again..
>>
> 
> I guess MSM8996 is the only platform affected by this? sdm630.dtsi seems
> to list the clock already in the a2noc and all others don't seem to have
> an interconnect driver yet.
> 
> This will be subjective and someone will surely disagree but...
> 
> IMO forcing all RPM clocks on during boot and keeping them enabled is
> not part of the DT ABI. If you don't describe the hardware correctly and
> are missing necessary clocks in the description (like the IPA_CLK on the
> interconnect node) then your DT is wrong and should be fixed.
> 
> I would see this a bit like typical optimizing C compilers nowadays. If
> you write correct code it can optimize, e.g. drop unnecessary function
> calls. But if you write incorrect code with undefined behavior it's not
> the fault of the compiler if you run into trouble. The code must be
> fixed.
> 
> The DT bindings don't specify that unused resources (clocks, ...) stay
> "magically" active. They specify that that the resources you reference
> are available. As such, I would say the OS is free to optimize here and
> turn off unused resources.
> 
> The more important point IMO is not breaking all platforms without
> interconnect drivers. This goes beyond just adding a missing clock to
> the DT, you need to write the driver first. But having the max vote in
> icc_smd_rpm (somehow) should hopefully take care of that.
Hm, interesting argument.

Krzysztof, Bjorn, what's your stance on this?

We *need* to add unused cleanup to rpmcc for feature completion and
there's no good way of discerning whether it's safe to do so..

Doing so will make clk_ignore_unused necessary to boot with legacy DTs.

Stephan argues the DTs were incomplete from the start and the breakage
is only a result of us previously abusing what's essentially undefined
behavior.. I think I second this, but it is *a* breakage so I want to
know your opinion.

FWIW the same happens when we have simple-framebuffer enabled and then
introduce dispcc on a given platform without adding the clocks under
the simplefb node and we've not been frowning upon that too much, so I'd
be willing to give it a pass if you're okay with it..

Not caring about this would make things far, far easier really..

Konrad
> 
>> I suppose something like this would work-ish:
>>
>> 0. remove clock handles as they're now contained within icc and
>>    use them as a "legacy marker"
>> 1. add:
>> 	if (qp->bus_clocks)
>> 		// skip qos writes
> 
> Maybe you can just check if all necessary clocks for QOS are there or
> not? I don't think it's a problem to skip it on broken DTs. I think it
> would be even fine to refuse loading the interconnect driver completely
> and just have the standard max vote (as long as that results in a
> booting system).
> 
>>
>> This will:
>> - let us add is_enabled so that all RPM clocks bar XO_A will be cleaned up
>> - save massively on code complexity
>>
> 
> +1
> 
>> at the cost of retroactively removing features (QoS settings) for people
>> with old DTs and new kernels (don't tell Torvalds!)
>>
> 
> I doubt anyone will notice :p
> 
>> This DTB ABI stuff really gets in the way sometimes :/ We're only now
>> fixing up U-Boot to be able to use upstream Linux DTs and other than
>> that I think only OpenBSD uses it with 8280.. Wish we could get rid of
>> all old junk once and then establish immutability but oh well..
> 
> Nice, thanks a lot for working on addressing the Qualcomm DT mess in
> U-Boot. I've been meaning to work this myself for a long time but never
> found the time to start... :')
> 
> Thanks,
> Stephan

  reply	other threads:[~2023-04-19 21:08 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 [this message]
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
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=6e55d3fa-744e-1f85-7642-6138f4e6e5a5@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=stephan@gerhold.net \
    /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

all inboxes | Powered by JetHome®