* [RESEND PATCH] regulator: core: Disable unused regulators after deferred probing is done
@ 2014-04-23 23:10 Nishanth Menon
2014-04-24 13:34 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Nishanth Menon @ 2014-04-23 23:10 UTC (permalink / raw)
To: linux-arm-kernel
From: Saravana Kannan <skannan@codeaurora.org>
regulator_init_complete does a scan of regulators which dont have
always-on or consumers are automatically disabled as being unused.
However, with deferred probing, late_initcall() is too soon to
declare a regulator as unused as the regulator itself might not
have registered due to defferal - Example: A regulator deffered due
to i2bus not available which in turn is deffered due to pinctrl
availability.
Since deferred probing is done in late_initcall(), do the cleanup of
unused regulators by regulator_init_complete in late_initcall_sync
instead of late_initcall.
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
[nm at ti.com: minor rewording]
Signed-off-by: Nishanth Menon <nm@ti.com>
---
Applies on v3.15-rc2 and on next-20140423
Original post: https://patchwork.kernel.org/patch/2545061/
I rediscovered this patch many times now :(:
Latest Example: https://patchwork.kernel.org/patch/4044811/
http://slexy.org/raw/s21MCHgeJo shows none of the unused regulators are disabled
and with this fix:
http://slexy.org/raw/s2TH36cThR (which auto disables unused regulators).
Ccying Markus as author of 66fda75f47dc (regulator: core: Replace
direct ops->disable usage) he might be interested as well.
Btw, this might open up a lot of broken boards - like we discovered
for DRA7 - so it might be a good idea for next instead of current rc
cyle giving it some time to cook and get platforms fixed.
drivers/regulator/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 9a09f3c..5a05de3 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3867,4 +3867,4 @@ unlock:
return 0;
}
-late_initcall(regulator_init_complete);
+late_initcall_sync(regulator_init_complete);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [RESEND PATCH] regulator: core: Disable unused regulators after deferred probing is done
2014-04-23 23:10 [RESEND PATCH] regulator: core: Disable unused regulators after deferred probing is done Nishanth Menon
@ 2014-04-24 13:34 ` Mark Brown
2014-04-24 14:18 ` Nishanth Menon
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2014-04-24 13:34 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Apr 23, 2014 at 06:10:50PM -0500, Nishanth Menon wrote:
> From: Saravana Kannan <skannan@codeaurora.org>
>
> regulator_init_complete does a scan of regulators which dont have
> always-on or consumers are automatically disabled as being unused.
> However, with deferred probing, late_initcall() is too soon to
> declare a regulator as unused as the regulator itself might not
> have registered due to defferal - Example: A regulator deffered due
> to i2bus not available which in turn is deffered due to pinctrl
> availability.
>
> Since deferred probing is done in late_initcall(), do the cleanup of
> unused regulators by regulator_init_complete in late_initcall_sync
> instead of late_initcall.
I'll apply this however since as we discussed on IRC last night it's
going to make the issues with unconfigured regulators getting powered
off more severe before I do so I'll change things so that regulators
with no configuration at all don't get touched by the core.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140424/ba3ce5f6/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [RESEND PATCH] regulator: core: Disable unused regulators after deferred probing is done
2014-04-24 13:34 ` Mark Brown
@ 2014-04-24 14:18 ` Nishanth Menon
0 siblings, 0 replies; 3+ messages in thread
From: Nishanth Menon @ 2014-04-24 14:18 UTC (permalink / raw)
To: linux-arm-kernel
On 04/24/2014 08:34 AM, Mark Brown wrote:
> On Wed, Apr 23, 2014 at 06:10:50PM -0500, Nishanth Menon wrote:
>> From: Saravana Kannan <skannan@codeaurora.org>
>>
>> regulator_init_complete does a scan of regulators which dont have
>> always-on or consumers are automatically disabled as being unused.
>> However, with deferred probing, late_initcall() is too soon to
>> declare a regulator as unused as the regulator itself might not
>> have registered due to defferal - Example: A regulator deffered due
>> to i2bus not available which in turn is deffered due to pinctrl
>> availability.
>>
>> Since deferred probing is done in late_initcall(), do the cleanup of
>> unused regulators by regulator_init_complete in late_initcall_sync
>> instead of late_initcall.
>
> I'll apply this however since as we discussed on IRC last night it's
> going to make the issues with unconfigured regulators getting powered
> off more severe before I do so I'll change things so that regulators
> with no configuration at all don't get touched by the core.
>
Thanks Mark.
--
Regards,
Nishanth Menon
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-24 14:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-23 23:10 [RESEND PATCH] regulator: core: Disable unused regulators after deferred probing is done Nishanth Menon
2014-04-24 13:34 ` Mark Brown
2014-04-24 14:18 ` Nishanth Menon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox