2024-06-10 12:01:10

by George Stark

[permalink] [raw]
Subject: [PATCH 1/1] regulator: core: add warning for not-recoverable state

If regulator is always-on or boot-on then it's expected to be on while
being probed so add warning if such a regulator is in not-recoverable
state during initialization.

Signed-off-by: George Stark <[email protected]>
---
drivers/regulator/core.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index a968dabb48f5..133789eb3d71 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1251,6 +1251,10 @@ static int machine_constraints_voltage(struct regulator_dev *rdev,
int current_uV = regulator_get_voltage_rdev(rdev);

if (current_uV == -ENOTRECOVERABLE) {
+ if (rdev->constraints->always_on || rdev->constraints->boot_on)
+ rdev_warn(rdev,
+ "boot-on / always-on regulator is in not-recoverable state\n");
+
/* This regulator can't be read and must be initialized */
rdev_info(rdev, "Setting %d-%duV\n",
rdev->constraints->min_uV,
--
2.25.1



2024-06-10 15:49:48

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 1/1] regulator: core: add warning for not-recoverable state

On Mon, Jun 10, 2024 at 03:00:25PM +0300, George Stark wrote:
> If regulator is always-on or boot-on then it's expected to be on while
> being probed so add warning if such a regulator is in not-recoverable
> state during initialization.

I don't see that these regulators are especially magical, and IIRC we
have several cases where we simply lack the ability to read back the
configuration at any time so expect to write out what we need during
normal operation.


Attachments:
(No filename) (474.00 B)
signature.asc (499.00 B)
Download all attachments