devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephan Gerhold <stephan@gerhold.net>
To: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Andy Gross <agross@kernel.org>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org,
	~postmarketos/upstreaming@lists.sr.ht
Subject: Re: [PATCH 8/8] arm64: dts: qcom: msm8916-pm8916: Mark always-on regulators
Date: Fri, 26 May 2023 14:55:56 +0200	[thread overview]
Message-ID: <ZHCsXKejQxuGH2ZP@gerhold.net> (raw)
In-Reply-To: <41f5b7a9-d927-e468-d1ea-291ad35ba943@linaro.org>

On Fri, May 26, 2023 at 10:50:53AM +0200, Konrad Dybcio wrote:
> On 26.05.2023 08:36, Stephan Gerhold wrote:
> > On Fri, May 26, 2023 at 02:28:52AM +0200, Konrad Dybcio wrote:
> >> On 26.05.2023 01:39, Konrad Dybcio wrote:
> >>> On 17.05.2023 20:48, Stephan Gerhold wrote:
> >>>> Some of the regulators must be always-on to ensure correct operation of
> >>>> the system, e.g. PM8916 L2 for the LPDDR RAM, L5 for most digital I/O
> >>>> and L7 for the CPU PLL (strictly speaking the CPU PLL might only need
> >>>> an active-only vote but this is not supported for regulators in
> >>>> mainline currently).
> >>> Would you be interested in implementing this?
> > 
> > At least on MSM8916 there is currently no advantage implementing this.
> > The "active-only" votes only have the CPU as limited use case. S1 (aka
> > MSM8916_VDDCX) and L3 (MSM8916_VDDMX) are both used via rpmpd/power
> > domains which already provides separate active-only variants. L7 (for
> > the CPU PLL) is the only other regulator used in "active-only" mode.
> > However, at least on MSM8916 L7 seems to stay always-on no matter what I
> > do, so having an active-only vote on L7 doesn't provide any advantage.
> In this case it may be more important that we tell RPM that we want it
> to be active-only, even if it ultimately makes a different decision.
> You probably played with this more, but my guess would be that not letting
> off of an a-s vote could confuse the algos
> 

I think in this case it does not make any difference. There is no
difference to downstream for the power consumption during VMIN suspend
(with these changes and my hack patches). In fact the power consumption
is so ridiculously low (about 0.008W / 0.096 A @ 12V) that my
measurement thing can barely measure it. :D

There are definitely more important things to work on right now that
will make a much larger difference. Perhaps one day when we have the
important things like cpuidle, bus scaling/interconnect etc we can look
again at this tiny little regulator that probably will never turn off
anyway. :D

> > 
> >> Actually, I think currently all votes are active-only votes and what
> >> we're missing is sleep-only (and active-sleep if we vote on both)
> > 
> > If you only send the "active" votes but no "sleep" votes for a resource
> > then the RPM firmware treats it as active+sleep, see [1].
> > The active/sleep separation only starts once a separate sleep vote has
> > been sent for a resource for the first time.
> > 
> > Therefore, all requests from the SMD regulator driver apply for both
> > active+sleep at the moment.
> > 
> > [1]: https://git.codelinaro.org/clo/la/kernel/msm-3.10/-/blob/LA.BR.1.2.9.1-02310-8x16.0/drivers/regulator/rpm-smd-regulator.c#L202-204
> /me *dies*
> 
> that's a design decision if i've ever seen one..
> 

:D

> > 
> >>>
> >>> Ancient downstream defines a second device (vregname_ao) and basically
> >>> seems to select QCOM_SMD_(ACTIVE/SLEEP)_STATE based on that..
> >>>
> >>> Looks like `struct regulator` stores voltage in an array that wouldn't
> >>> you know it, depends on the PM state. Perhaps that could be something
> >>> to explore!
> >>>
> > 
> > Don't get confused by the similar naming here. RPM sleep votes are
> > unrelated to the "system suspend" voltages the regulator framework
> > supports. :)
> > 
> > RPM sleep votes become active if the cpuidle reaches the deepest state
> > for the (cpu/)cluster(/CCI). This can happen anytime at runtime when the
> > system is idle long enough. On the other hand, the regulator suspend
> > voltages are meant to become active during system suspend (where all the
> > devices get suspended as well).
> Yes and pm_genpd tracks that very meticulously, at least in the case of PSCI.

Meh, having a proper PSCI implementation is luxury! I have to mess with
the good old way of poking the SPM/SAWs from Linux... :P

Thanks,
Stephan

  reply	other threads:[~2023-05-26 12:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-17 18:48 [PATCH 0/8] arm64: dts: qcom: msm8916: Rework regulator constraints Stephan Gerhold
2023-05-17 18:48 ` [PATCH 1/8] arm64: dts: qcom: apq8016-sbc: Fix " Stephan Gerhold
2023-05-17 18:48 ` [PATCH 2/8] arm64: dts: qcom: apq8016-sbc: Fix 1.8V power rail on LS expansion Stephan Gerhold
2023-05-17 18:48 ` [PATCH 3/8] arm64: dts: qcom: msm8916: Fix regulator constraints Stephan Gerhold
2023-05-26 13:38   ` Bryan O'Donoghue
2023-05-26 14:03     ` Stephan Gerhold
2023-05-26 15:42   ` Bryan O'Donoghue
2023-05-26 15:43   ` Bryan O'Donoghue
2023-05-17 18:48 ` [PATCH 4/8] arm64: dts: qcom: msm8916: Disable audio codecs by default Stephan Gerhold
2023-05-17 18:48 ` [PATCH 5/8] arm64: dts: qcom: pm8916: Move default regulator "-supply"s Stephan Gerhold
2023-05-17 18:48 ` [PATCH 6/8] arm64: dts: qcom: msm8916-pm8916: Clarify purpose Stephan Gerhold
2023-05-17 18:48 ` [PATCH 7/8] arm64: dts: qcom: msm8916: Define regulator constraints next to usage Stephan Gerhold
2023-05-25 23:35   ` Konrad Dybcio
2023-05-26  6:47     ` Stephan Gerhold
2023-05-26 21:11       ` Konrad Dybcio
2023-05-27  9:22         ` Stephan Gerhold
2023-05-17 18:48 ` [PATCH 8/8] arm64: dts: qcom: msm8916-pm8916: Mark always-on regulators Stephan Gerhold
2023-05-25 23:39   ` Konrad Dybcio
2023-05-26  0:28     ` Konrad Dybcio
2023-05-26  6:36       ` Stephan Gerhold
2023-05-26  8:50         ` Konrad Dybcio
2023-05-26 12:55           ` Stephan Gerhold [this message]
2023-05-25  4:54 ` [PATCH 0/8] arm64: dts: qcom: msm8916: Rework regulator constraints 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=ZHCsXKejQxuGH2ZP@gerhold.net \
    --to=stephan@gerhold.net \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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).