All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Add reg_ignore_unused and pd_ignore_unused
@ 2014-03-28  5:20 Tushar Behera
  2014-03-28  5:20 ` [PATCH 1/2] PM / Domains: Add pd_ignore_unused to keep power domains enabled Tushar Behera
  2014-03-28  5:20 ` [PATCH 2/2] regulator: core: Add reg_ignore_unused to keep boot time regulators enabled Tushar Behera
  0 siblings, 2 replies; 6+ messages in thread
From: Tushar Behera @ 2014-03-28  5:20 UTC (permalink / raw)
  To: linux-doc, linux-kernel
  Cc: rob, olof, Rafael J. Wysocki, linux-pm, Mark Brown

These patches take inspiration from Olof's following patch.
1e435256d625 "clk: add clk_ignore_unused option to keep boot clocks on"

This options are solely for debug purposes to figure out whether
the issue at hand is because of improper shutdown of regulators or
power-domains.

Tushar Behera (2):
  PM / Domains: Add pd_ignore_unused to keep power domains enabled
  regulator: core: Add reg_ignore_unused to keep boot time regulators
    enabled

 Documentation/kernel-parameters.txt |   15 +++++++++++++++
 drivers/base/power/domain.c         |   13 +++++++++++++
 drivers/regulator/core.c            |   13 +++++++++++++
 3 files changed, 41 insertions(+)

CC: "Rafael J. Wysocki" <rjw@rjwysocki.net>
CC: linux-pm@vger.kernel.org
CC: Mark Brown <broonie@kernel.org>

-- 
1.7.9.5


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

* [PATCH 1/2] PM / Domains: Add pd_ignore_unused to keep power domains enabled
  2014-03-28  5:20 [PATCH 0/2] Add reg_ignore_unused and pd_ignore_unused Tushar Behera
@ 2014-03-28  5:20 ` Tushar Behera
  2014-03-28  5:20 ` [PATCH 2/2] regulator: core: Add reg_ignore_unused to keep boot time regulators enabled Tushar Behera
  1 sibling, 0 replies; 6+ messages in thread
From: Tushar Behera @ 2014-03-28  5:20 UTC (permalink / raw)
  To: linux-doc, linux-kernel; +Cc: rob, olof, Rafael J. Wysocki, linux-pm

Keep all power-domains 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@linaro.org>
CC: "Rafael J. Wysocki" <rjw@rjwysocki.net>
CC: linux-pm@vger.kernel.org
---
 Documentation/kernel-parameters.txt |    7 +++++++
 drivers/base/power/domain.c         |   13 +++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 50a001a..96bb532 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2557,6 +2557,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 
 	pcmv=		[HW,PCMCIA] BadgePAD 4
 
+	pd_ignore_unused
+			[PM]
+			Keep all power-domains 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.
+
 	pd.		[PARIDE]
 			See Documentation/blockdev/paride.txt.
 
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 6f54962..ae098a2 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -705,6 +705,14 @@ static int pm_genpd_runtime_resume(struct device *dev)
 	return 0;
 }
 
+static bool pd_ignore_unused;
+static int __init pd_ignore_unused_setup(char *__unused)
+{
+	pd_ignore_unused = true;
+	return 1;
+}
+__setup("pd_ignore_unused", pd_ignore_unused_setup);
+
 /**
  * pm_genpd_poweroff_unused - Power off all PM domains with no devices in use.
  */
@@ -712,6 +720,11 @@ void pm_genpd_poweroff_unused(void)
 {
 	struct generic_pm_domain *genpd;
 
+	if (pd_ignore_unused) {
+		pr_warn("genpd: Not disabling unused power domains\n");
+		return;
+	}
+
 	mutex_lock(&gpd_list_lock);
 
 	list_for_each_entry(genpd, &gpd_list, gpd_list_node)
-- 
1.7.9.5


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

* [PATCH 2/2] regulator: core: Add reg_ignore_unused to keep boot time regulators enabled
  2014-03-28  5:20 [PATCH 0/2] Add reg_ignore_unused and pd_ignore_unused Tushar Behera
  2014-03-28  5:20 ` [PATCH 1/2] PM / Domains: Add pd_ignore_unused to keep power domains enabled Tushar Behera
@ 2014-03-28  5:20 ` Tushar Behera
  2014-03-28 10:22   ` Mark Brown
  1 sibling, 1 reply; 6+ messages in thread
From: Tushar Behera @ 2014-03-28  5:20 UTC (permalink / raw)
  To: linux-doc, linux-kernel; +Cc: rob, olof, Mark Brown

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@linaro.org>
CC: Mark Brown <broonie@kernel.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


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

* Re: [PATCH 2/2] regulator: core: Add reg_ignore_unused to keep boot time regulators enabled
  2014-03-28  5:20 ` [PATCH 2/2] regulator: core: Add reg_ignore_unused to keep boot time regulators enabled Tushar Behera
@ 2014-03-28 10:22   ` Mark Brown
  2014-04-01 13:29     ` Tushar Behera
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2014-03-28 10:22 UTC (permalink / raw)
  To: Tushar Behera; +Cc: linux-doc, linux-kernel, rob, olof

[-- Attachment #1: Type: text/plain, Size: 668 bytes --]

On Fri, Mar 28, 2014 at 10:50:22AM +0530, Tushar Behera wrote:
> 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.

That's already the default on non-DT systems so I'd expect that if we
were doing this the code would be joined up with the code for that.  I'm
not sure this is a terribly good idea though - we already display a
message just before we power off the regulator and having an option like
this feels like it's going to encourage people to write bad DTs and tell
people to add this to their command line.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 2/2] regulator: core: Add reg_ignore_unused to keep boot time regulators enabled
  2014-03-28 10:22   ` Mark Brown
@ 2014-04-01 13:29     ` Tushar Behera
  2014-04-01 15:58       ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Tushar Behera @ 2014-04-01 13:29 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-doc, lkml, Rob Landley, Olof Johansson

On 28 March 2014 15:52, Mark Brown <broonie@kernel.org> wrote:
> On Fri, Mar 28, 2014 at 10:50:22AM +0530, Tushar Behera wrote:
>> 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.
>
> That's already the default on non-DT systems so I'd expect that if we
> were doing this the code would be joined up with the code for that.  I'm
> not sure this is a terribly good idea though - we already display a
> message just before we power off the regulator and having an option like
> this feels like it's going to encourage people to write bad DTs and tell
> people to add this to their command line.

I agree with your point that it may lead developers to write bad DTs,
but it becomes quite helpful while debugging issues.

-- 
Tushar Behera

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

* Re: [PATCH 2/2] regulator: core: Add reg_ignore_unused to keep boot time regulators enabled
  2014-04-01 13:29     ` Tushar Behera
@ 2014-04-01 15:58       ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2014-04-01 15:58 UTC (permalink / raw)
  To: Tushar Behera; +Cc: linux-doc, lkml, Rob Landley, Olof Johansson

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

On Tue, Apr 01, 2014 at 06:59:04PM +0530, Tushar Behera wrote:

> I agree with your point that it may lead developers to write bad DTs,
> but it becomes quite helpful while debugging issues.

So make what you're trying to do look more like a debug option then...
though to be honest given how easy things are to resolve and the prints
that are there already I'm not sure it's that helpful.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2014-04-01 15:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-28  5:20 [PATCH 0/2] Add reg_ignore_unused and pd_ignore_unused Tushar Behera
2014-03-28  5:20 ` [PATCH 1/2] PM / Domains: Add pd_ignore_unused to keep power domains enabled Tushar Behera
2014-03-28  5:20 ` [PATCH 2/2] regulator: core: Add reg_ignore_unused to keep boot time regulators enabled Tushar Behera
2014-03-28 10:22   ` Mark Brown
2014-04-01 13:29     ` Tushar Behera
2014-04-01 15:58       ` Mark Brown

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.