Re: [PATCH v5 3/4] regulator: qcom-rpmh: readback voltage/bypass/mode/status set during bootup

From: Mark Brown

Date: Fri Jul 24 2026 - 08:52:54 EST


On Fri, Jul 24, 2026 at 04:13:02PM +0530, Kamal Wadhwa wrote:
> On Wed, Jul 22, 2026 at 05:46:37PM +0100, Mark Brown wrote:

> > A get_status() operation should be reading the actual hardware status
> > right now, not driver state - this should be reading whatever the value
> > is right now. If the hardware doesn't support this then just don't
> > provide the operation.

> Actually we are reading from HW what we voted in terms of ENABLE/BYPASS/MODE
> and we are combing these in the `rpmh_regulator_determine_initial_status()`
> to come up with the `vreg->status`at the time of probe.

No, that's not the point. A get_status() operation needs to return the
actual hardware status *now*, not a cached value from some random time
in the past and not something that was written by the driver.

> So, shall I read the HW MODE/BYPSS/ENABLE value in every get_status() call?

If they reflect values that might be dynamically updated by the
hardware, yes. If they are just control registers that the hardware
will not update autonomously they are not suitable for a get_status()
operation.