All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: core: Let boot-on regulators be powered off
@ 2022-01-21 23:34 Andre Kalb
  2022-01-24  9:44 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Andre Kalb @ 2022-01-21 23:34 UTC (permalink / raw)
  To: stable

[ Upstream commit 089b3f61ecfc43ca4ea26d595e1d31ead6de3f7b ]

Boot-on regulators are always kept on because their use_count value
is now incremented at boot time and never cleaned.

Only increment count value for alway-on regulators.
regulator_late_cleanup() is now able to power off boot-on regulators
when unused.

Fixes: 45f9c1b2e57c ("regulator: core: Clean enabling always-on regulators + their supplies")
Signed-off-by: Pascal Paillet <p.paillet@st.com>
Link: https://lore.kernel.org/r/20191113102737.27831-1-p.paillet@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Acked-by: Andre Kalb <andre.kalb@sma.de>
# 4.19.x
---
 drivers/regulator/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 088ed4ee6d83..045075cd256c 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1211,7 +1211,9 @@ static int set_machine_constraints(struct regulator_dev *rdev)
 			rdev_err(rdev, "failed to enable\n");
 			return ret;
 		}
-		rdev->use_count++;
+
+		if (rdev->constraints->always_on)
+			rdev->use_count++;
 	}
 
 	print_constraints(rdev);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] regulator: core: Let boot-on regulators be powered off
  2022-01-21 23:34 [PATCH] regulator: core: Let boot-on regulators be powered off Andre Kalb
@ 2022-01-24  9:44 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2022-01-24  9:44 UTC (permalink / raw)
  To: Andre Kalb; +Cc: stable

On Sat, Jan 22, 2022 at 12:34:07AM +0100, Andre Kalb wrote:
> [ Upstream commit 089b3f61ecfc43ca4ea26d595e1d31ead6de3f7b ]
> 
> Boot-on regulators are always kept on because their use_count value
> is now incremented at boot time and never cleaned.
> 
> Only increment count value for alway-on regulators.
> regulator_late_cleanup() is now able to power off boot-on regulators
> when unused.
> 
> Fixes: 45f9c1b2e57c ("regulator: core: Clean enabling always-on regulators + their supplies")
> Signed-off-by: Pascal Paillet <p.paillet@st.com>
> Link: https://lore.kernel.org/r/20191113102737.27831-1-p.paillet@st.com
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Acked-by: Andre Kalb <andre.kalb@sma.de>
> # 4.19.x
> ---
>  drivers/regulator/core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-24  9:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-21 23:34 [PATCH] regulator: core: Let boot-on regulators be powered off Andre Kalb
2022-01-24  9:44 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.