Linux Documentation
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Tzung-Bi Shih <tzungbi@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Pavel Machek <pavel@kernel.org>, Len Brown <lenb@kernel.org>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, driver-core@lists.linux.dev,
	tfiga@chromium.org, senozhatsky@chromium.org,
	Randy Dunlap <rdunlap@infradead.org>
Subject: Re: [PATCH v5 2/2] PM: dpm_watchdog: Allow disabling DPM watchdog by default
Date: Wed, 1 Jul 2026 09:20:46 +0200	[thread overview]
Message-ID: <2026070140-rally-prowling-4d66@gregkh> (raw)
In-Reply-To: <20260701045640.3130090-3-tzungbi@kernel.org>

On Wed, Jul 01, 2026 at 04:56:40AM +0000, Tzung-Bi Shih wrote:
> Introduce the "dpm_watchdog_enabled" module parameter to allow the DPM
> watchdog to be enabled or disabled at boot time and runtime.

As I say all the time, this isn't the 1990's, please don't add new
module parameters as they are a pain to manage and maintain over time
(as you found out with my rejection of patch 1/2 here...)

> Additionally, introduce the CONFIG_DPM_WATCHDOG_ENABLED Kconfig option
> to set default value of the module parameter at compile time.
> 
> This provides flexibility for systems that want the watchdog code
> compiled in but inactive by default, allowing it to be enabled only when
> needed.
> 
> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
> ---
> v5: No changes.
> 
> v4: https://lore.kernel.org/all/20260611021219.2093476-2-tzungbi@kernel.org
> - Rewrite the commit message to indicate the module parameter is the
>   main change in the patch.
> - DPM_WATCHDOG_DEFAULT_ENABLED -> DPM_WATCHDOG_ENABLED.
> 
> v3: https://lore.kernel.org/all/20260608021526.1023248-3-tzungbi@kernel.org
> - Add "PM" tag (was missing).
> - Update the format and specify dependencies in kernel-parameters.txt.
> - Update the help message in Kconfig to reflect that dpm_watchdog_enabled
>   can be set at runtime as well.
> 
> v2: https://lore.kernel.org/all/20260604090756.2884671-3-tzungbi@kernel.org
> - Use module parameter and bool for dpm_watchdog_enabled.
> - Use IS_ENABLED().
> 
> v1: https://lore.kernel.org/all/20260528103215.505795-1-tzungbi@kernel.org
> ---
>  Documentation/admin-guide/kernel-parameters.txt |  7 +++++++
>  drivers/base/power/main.c                       | 11 +++++++++++
>  kernel/power/Kconfig                            | 10 ++++++++++
>  3 files changed, 28 insertions(+)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index b5493a7f8f22..46c20e1b5f05 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -47,6 +47,7 @@
>  	PCI	PCI bus support is enabled.
>  	PCIE	PCI Express support is enabled.
>  	PCMCIA	The PCMCIA subsystem is enabled.
> +	PM	Power Management support is enabled.
>  	PNP	Plug & Play support is enabled.
>  	PPC	PowerPC architecture is enabled.
>  	PPT	Parallel port support is enabled.
> @@ -5354,6 +5355,12 @@ Kernel parameters
>  	pm_debug_messages	[SUSPEND,KNL]
>  			Enable suspend/resume debug messages during boot up.
>  
> +	pm_sleep.dpm_watchdog_enabled=
> +			[PM] Enable or disable the DPM watchdog.  Requires
> +			CONFIG_PM_SLEEP and CONFIG_DPM_WATCHDOG enabled.
> +			Format: <bool>
> +			Default value is set by CONFIG_DPM_WATCHDOG_ENABLED.
> +
>  	pnp.debug=1	[PNP]
>  			Enable PNP debug messages (depends on the
>  			CONFIG_PNP_DEBUG_MESSAGES option).  Change at run-time
> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> index c6a3300cfb7a..f58945758868 100644
> --- a/drivers/base/power/main.c
> +++ b/drivers/base/power/main.c
> @@ -535,6 +535,11 @@ module_param(dpm_watchdog_all_cpu_backtrace, bool, 0644);
>  MODULE_PARM_DESC(dpm_watchdog_all_cpu_backtrace,
>  		 "Backtrace all CPUs on DPM watchdog timeout");
>  
> +static bool __read_mostly dpm_watchdog_enabled =
> +				IS_ENABLED(CONFIG_DPM_WATCHDOG_ENABLED);
> +module_param(dpm_watchdog_enabled, bool, 0644);
> +MODULE_PARM_DESC(dpm_watchdog_enabled, "Enable DPM watchdog");
> +
>  static unsigned int __read_mostly dpm_watchdog_timeout = CONFIG_DPM_WATCHDOG_TIMEOUT;
>  static unsigned int __read_mostly dpm_watchdog_warning_timeout =
>  						CONFIG_DPM_WATCHDOG_WARNING_TIMEOUT;
> @@ -630,6 +635,9 @@ static void dpm_watchdog_set(struct dpm_watchdog *wd, struct device *dev)
>  {
>  	struct timer_list *timer = &wd->timer;
>  
> +	if (!dpm_watchdog_enabled)
> +		return;
> +
>  	wd->dev = dev;
>  	wd->tsk = current;
>  	wd->fatal = dpm_watchdog_timeout == dpm_watchdog_warning_timeout;
> @@ -648,6 +656,9 @@ static void dpm_watchdog_clear(struct dpm_watchdog *wd)
>  {
>  	struct timer_list *timer = &wd->timer;
>  
> +	if (!dpm_watchdog_enabled)
> +		return;
> +
>  	timer_delete_sync(timer);
>  	timer_destroy_on_stack(timer);
>  }
> diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
> index 530c897311d4..508ceabc4d2e 100644
> --- a/kernel/power/Kconfig
> +++ b/kernel/power/Kconfig
> @@ -268,6 +268,16 @@ config DPM_WATCHDOG
>  	  captured in pstore device for inspection in subsequent
>  	  boot session.
>  
> +config DPM_WATCHDOG_ENABLED
> +	bool "Enable DPM watchdog by default"
> +	depends on DPM_WATCHDOG
> +	default y

Only do this if you can not boot without the option enabled, which I do
not think is the case here.

thanks,

greg k-h

  reply	other threads:[~2026-07-01  7:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01  4:56 [PATCH v5 0/2] PM: dpm_watchdog: Improve DPM watchdog configurability Tzung-Bi Shih
2026-07-01  4:56 ` [PATCH v5 1/2] PM: sleep: Rename module parameters prefix to "pm_sleep" Tzung-Bi Shih
2026-07-01  7:19   ` Greg Kroah-Hartman
2026-07-01 11:27     ` Rafael J. Wysocki (Intel)
2026-07-02  6:11       ` Tzung-Bi Shih
2026-07-01  4:56 ` [PATCH v5 2/2] PM: dpm_watchdog: Allow disabling DPM watchdog by default Tzung-Bi Shih
2026-07-01  7:20   ` Greg Kroah-Hartman [this message]
2026-07-01 12:53     ` Rafael J. Wysocki (Intel)
2026-07-02  6:12       ` Tzung-Bi Shih

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=2026070140-rally-prowling-4d66@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=corbet@lwn.net \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=lenb@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@kernel.org \
    --cc=rafael@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=senozhatsky@chromium.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tfiga@chromium.org \
    --cc=tzungbi@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