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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 28 Mar 2014 10:50:22 +0530
From:	Tushar Behera <tushar.behera@...aro.org>
To:	linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:	rob@...dley.net, olof@...om.net, Mark Brown <broonie@...nel.org>
Subject: [PATCH 2/2] regulator: core: Add reg_ignore_unused to keep boot time regulators enabled

Keep all regulators already enabled by bootloader on, even if no
driver has claimed them. This is useful for debug and development, but
should not be needed on a platform with proper driver support.

Signed-off-by: Tushar Behera <tushar.behera@...aro.org>
CC: Mark Brown <broonie@...nel.org>
---
 Documentation/kernel-parameters.txt |    8 ++++++++
 drivers/regulator/core.c            |   13 +++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 96bb532..20448e0 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -92,6 +92,7 @@ parameter is applicable:
 	PPT	Parallel port support is enabled.
 	PS2	Appropriate PS/2 support is enabled.
 	RAM	RAM disk support is enabled.
+	REG	Regulator support is enabled.
 	S390	S390 architecture is enabled.
 	SCSI	Appropriate SCSI support is enabled.
 			A lot of drivers have their options described inside
@@ -2886,6 +2887,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 			      reboot_cpu is s[mp]#### with #### being the processor
 					to be used for rebooting.
 
+	reg_ignore_unused
+			[REG]
+			Keep all regulators already enabled by bootloader on,
+			even if no driver has claimed them. This is useful
+			for debug and development, but should not be
+			needed on a platform with proper driver support.
+
 	relax_domain_level=
 			[KNL, SMP] Set scheduler's default relax_domain_level.
 			See Documentation/cgroups/cpusets.txt.
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 9a09f3c..6e8305a 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3800,6 +3800,14 @@ static int __init regulator_init(void)
 /* init early to allow our consumers to complete system booting */
 core_initcall(regulator_init);
 
+static bool reg_ignore_unused;
+static int __init reg_ignore_unused_setup(char *__unused)
+{
+	reg_ignore_unused = true;
+	return 1;
+}
+__setup("reg_ignore_unused", reg_ignore_unused_setup);
+
 static int __init regulator_init_complete(void)
 {
 	struct regulator_dev *rdev;
@@ -3807,6 +3815,11 @@ static int __init regulator_init_complete(void)
 	struct regulation_constraints *c;
 	int enabled, ret;
 
+	if (reg_ignore_unused) {
+		pr_warn("reg: Not disabling unused regulators\n");
+		return 0;
+	}
+
 	/*
 	 * Since DT doesn't provide an idiomatic mechanism for
 	 * enabling full constraints and since it's much more natural
-- 
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