mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Javier Martinez Canillas <javierm@redhat.com>,
	linux-kernel@vger.kernel.org
Cc: Manivannan Sadhasivam <mani@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	"Steven Rostedt (Google)" <rostedt@goodmis.org>,
	Tejun Heo <tj@kernel.org>,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH] regulator: core: Add option to prevent disabling unused regulators
Date: Sat, 28 Oct 2023 09:04:02 -0700	[thread overview]
Message-ID: <36e87cdb-9341-4e86-a1ad-dc2d1d105fa8@infradead.org> (raw)
In-Reply-To: <20231028102423.179400-1-javierm@redhat.com>

Hi,

On 10/28/23 03:24, Javier Martinez Canillas wrote:
> This may be useful for debugging and develompent purposes, when there are
> drivers that depend on regulators to be enabled but do not request them.
> 
> It is inspired from the clk_ignore_unused and pd_ignore_unused parameters,
> that are used to keep firmware-enabled clocks and power domains on even if
> these are not used by drivers.
> 
> The parameter is not expected to be used in normal cases and should not be
> needed on a platform with proper driver support.
> 
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> ---
> 
>  Documentation/admin-guide/kernel-parameters.txt |  7 +++++++
>  drivers/regulator/core.c                        | 17 +++++++++++++++++
>  2 files changed, 24 insertions(+)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 0a1731a0f0ef..91b58d767c2c 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -5461,6 +5461,13 @@
>  			print every Nth verbose statement, where N is the value
>  			specified.
>  
> +	regulator_ignore_unused
> +			[REGULATOR]
> +			Prevents the regulator framework to disable regulators

			                                 from disabling regulators

> +			that are unused due not driver claiming them. This may

			                    no driver claiming them.

> +			be 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/admin-guide/cgroup-v1/cpusets.rst.
> diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
> index 3137e40fcd3e..220034ff0273 100644
> --- a/drivers/regulator/core.c
> +++ b/drivers/regulator/core.c
> @@ -6234,6 +6234,14 @@ static int regulator_late_cleanup(struct device *dev, void *data)
>  	return 0;
>  }
>  
> +static bool regulator_ignore_unused;
> +static int __init regulator_ignore_unused_setup(char *__unused)
> +{
> +	regulator_ignore_unused = true;
> +	return 1;
> +}
> +__setup("regulator_ignore_unused", regulator_ignore_unused_setup);
> +
>  static void regulator_init_complete_work_function(struct work_struct *work)
>  {
>  	/*
> @@ -6246,6 +6254,15 @@ static void regulator_init_complete_work_function(struct work_struct *work)
>  	class_for_each_device(&regulator_class, NULL, NULL,
>  			      regulator_register_resolve_supply);
>  
> +	/*
> +	 * For debugging purposes, it may be useful to prevent unused
> +	 * regulators to be disabled.

	              from being disabled.

> +	 */
> +	if (regulator_ignore_unused) {
> +		pr_warn("regulator: Not disabling unused regulators\n");
> +		return;
> +	}
> +
>  	/* If we have a full configuration then disable any regulators
>  	 * we have permission to change the status for and which are
>  	 * not in use or always_on.  This is effectively the default

HTH.
-- 
~Randy

  reply	other threads:[~2023-10-28 16:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-28 10:24 Javier Martinez Canillas
2023-10-28 16:04 ` Randy Dunlap [this message]
2023-10-30 14:53 ` Brian Masney
2023-11-01  4:56 ` Manivannan Sadhasivam
2023-11-01 13:09   ` Mark Brown
2023-11-02  9:33     ` Javier Martinez Canillas
2023-11-13 19:40 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36e87cdb-9341-4e86-a1ad-dc2d1d105fa8@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=broonie@kernel.org \
    --cc=corbet@lwn.net \
    --cc=javierm@redhat.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®