From: Kamal Wadhwa <kamal.wadhwa@oss.qualcomm.com>
To: Mark Brown <broonie@kernel.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
David Collins <david.collins@oss.qualcomm.com>
Subject: Re: [PATCH 2/2] regulator: qcom-rpmh: Add support to read regulator settings
Date: Thu, 24 Jul 2025 12:18:43 +0530 [thread overview]
Message-ID: <CADhhZXaTVqEcm_6w2keV42K+1uq9mruYZGp3OAWouK_4K-G4rw@mail.gmail.com> (raw)
In-Reply-To: <e5a44c70-e64a-47e7-8e45-3e1ae4f0ceb0@sirena.org.uk>
Hi Mark,
On Mon, Jun 23, 2025 at 10:34 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Mon, Jun 23, 2025 at 10:13:41PM +0530, Kamal Wadhwa wrote:
>
> > To address this issue, enhance the `get_voltage_sel()`,
> > `get_mode()`, and `is_enabled()` callbacks to read the regulator
> > settings directly from the RPMH hardware using the `rpmh_read()`
>
> Two things here. One is that my understanding was that at least some of
> the firmwares simply do not provide read functionality - this new code
> will turn that into an error if it's the case. The other is that
> there's an expectation that the read operations will return the value
> that was configured by the host, we might get confused if that's not the
> case. I'm not sure if there's paths that are currently implemented
> that'd have issues, but it's a concern.
This change should not violate the 2 things you have highlighted.
To elaborate, the regulator status will be read by APPS as ON if the rail was
requested ON by APPS, before reaching kernel stage. And will *not* be
seen as ON if it’s voted from some other subsystem DSP.
One important note here (about an exception to the above statement),
Internally all rails are ‘assigned' to a subsystem. Even rails shared between 2
or more subsystems are 'internally assigned’ to only one of those subsystems.
Boot loader code initializes the RPMh votes of the 'assigned' subsystem to match
the physical status of each regulator after the power-on sequence completes.
This ensures correct RPMh regulator parameter aggregation when subsystems
issue their own votes.
So, if a rail which is internally assigned to the APPS subsystem, gets
turned ON by
PMIC HW ( power ON sequence), in such cases too, the rail may be seen
ON from APPS side. This is the exception.
But this exception only applies if default ON rails is ‘internally assigned’ to
APPS subsystem. And will *not* happen if the rail was assigned to some other
subsystem DSP (and was turned ON from PMIC HW). In such a case status
will still be seen as OFF from APPS (as expected), even though they may actually
be ON.
>
> For the enable there's a separate status callback that should be
> implemented, and you could bootstrap the state. For the voltage
> readback it's a range that's configured so it should be fine to just do
> this I think, though I'd need to go double check the code for keeping
> multiple supplies tied within a range.
Sure, I will bootstrap the state(ON/OFF), and move the read logic to
get_status() op.
prev parent reply other threads:[~2025-07-24 6:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-23 16:43 [PATCH 0/2] Add support to read RPMH regulator settings Kamal Wadhwa
2025-06-23 16:43 ` [PATCH 1/2] soc: qcom: rpmh: Add support to read back resource settings Kamal Wadhwa
2025-06-24 14:44 ` Konrad Dybcio
2025-07-08 5:07 ` Maulik Shah (mkshah)
2025-06-23 16:43 ` [PATCH 2/2] regulator: qcom-rpmh: Add support to read regulator settings Kamal Wadhwa
2025-06-23 17:03 ` Mark Brown
2025-07-24 6:48 ` Kamal Wadhwa [this message]
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=CADhhZXaTVqEcm_6w2keV42K+1uq9mruYZGp3OAWouK_4K-G4rw@mail.gmail.com \
--to=kamal.wadhwa@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=broonie@kernel.org \
--cc=david.collins@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).