lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 23 Apr 2014 18:10:50 -0500
From:	Nishanth Menon <nm@...com>
To:	Mark Brown <broonie@...nel.org>
CC:	<linux-omap@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>,
	Saravana Kannan <skannan@...eaurora.org>,
	Liam Girdwood <lgirdwood@...il.com>,
	Markus Pargmann <mpa@...gutronix.de>,
	Nishanth Menon <nm@...com>
Subject: [RESEND PATCH] regulator: core: Disable unused regulators after deferred probing is done

From: Saravana Kannan <skannan@...eaurora.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@...il.com>
Cc: Mark Brown <broonie@...nel.org>
Cc: Markus Pargmann <mpa@...gutronix.de>
Signed-off-by: Saravana Kannan <skannan@...eaurora.org>
[nm@...com: minor rewording]
Signed-off-by: Nishanth Menon <nm@...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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ