From: Mario Limonciello <superm1@kernel.org>
To: Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>, Pavel Machek <pavel@kernel.org>
Cc: "Denis Benato" <benato.denis96@gmail.com>,
"AceLan Kao" <acelan.kao@canonical.com>,
"Kai-Heng Feng" <kaihengf@nvidia.com>,
"Mark Pearson" <mpearson-lenovo@squebb.ca>,
"Merthan Karakaş" <m3rthn.k@gmail.com>,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
linux-pm@vger.kernel.org,
"Mario Limonciello" <superm1@kernel.org>,
"Bartu Alev" <bartualev@gmail.com>
Subject: [PATCH 2/2] PM: Add shutdown=legacy command line option
Date: Mon, 02 Nov 2026 07:54:10 -0600 [thread overview]
Message-ID: <20261102-superm1-s4-at-s5-v1-2-313e0012dd39@kernel.org> (raw)
In-Reply-To: <20261102-superm1-s4-at-s5-v1-0-313e0012dd39@kernel.org>
Powering off now uses the hibernation callback flow when it is available.
Add an escape valve for systems that fail with this flow.
The shutdown=legacy option restores the device_shutdown() path. Document
it in the kernel parameter reference and the shutdown debugging guide.
Tested-by: Bartu Alev <bartualev@gmail.com>
Tested-by: Merthan Karakaş <m3rthn.k@gmail.com>
Signed-off-by: Mario Limonciello <superm1@kernel.org>
---
Bartu specifically tested his ASUS FA507 with this series. His laptop
got really hot in S5 before the series. He also intentionally used
this debug knob to verify the problem comes back.
Merthan tested on his ASUS laptop and it fixed system getting hot at
S5.
---
Documentation/admin-guide/kernel-parameters.txt | 4 ++++
Documentation/power/shutdown-debugging.rst | 7 ++++++-
kernel/reboot.c | 10 +++++++++-
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 0b3c140babd94..16d584bdbb73d 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -6981,6 +6981,10 @@ Kernel parameters
shapers= [NET]
Maximal number of shapers.
+ shutdown=legacy [KNL]
+ Use the legacy device shutdown callbacks when powering off
+ the system instead of the hibernation power-off callbacks.
+
show_lapic= [APIC,X86] Advanced Programmable Interrupt Controller
Limit apic dumping. The parameter defines the maximal
number of local apics being dumped. Also it is possible
diff --git a/Documentation/power/shutdown-debugging.rst b/Documentation/power/shutdown-debugging.rst
index c510122e0bbc2..254cd3e0b5907 100644
--- a/Documentation/power/shutdown-debugging.rst
+++ b/Documentation/power/shutdown-debugging.rst
@@ -33,7 +33,7 @@ some potential options include:
Kernel Command-line Parameters
==============================
-Add these parameters to your kernel command line:
+Add these parameters to your kernel command line to capture shutdown logs:
* ``printk.always_kmsg_dump=Y``
* Forces the kernel to dump the entire message buffer to pstore during
@@ -41,6 +41,11 @@ Add these parameters to your kernel command line:
* ``efi_pstore.pstore_disable=N``
* For EFI-based systems, ensures the EFI backend is active
+If the system fails while running the hibernation power-off callbacks, add
+``shutdown=legacy`` to use the legacy device shutdown callbacks instead. This
+can be used to work around the failure and confirm which callback flow caused
+it.
+
Userspace Interaction and Log Retrieval
=======================================
On the next boot after a hang, pstore logs will be available in the pstore
diff --git a/kernel/reboot.c b/kernel/reboot.c
index 1ad8629fde4d9..6c80356b9a85f 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -70,6 +70,7 @@ struct sys_off_handler {
* of that.
*/
static bool poweroff_fallback_to_halt;
+static bool shutdown_legacy;
/*
* Temporary stub that prevents linkage failure while we're in process
@@ -317,7 +318,7 @@ static void kernel_shutdown_prepare(enum system_states state)
system_state = state;
usermodehelper_disable();
#ifdef CONFIG_HIBERNATE_CALLBACKS
- if (state == SYSTEM_POWER_OFF) {
+ if (state == SYSTEM_POWER_OFF && !shutdown_legacy) {
if (!dpm_suspend_start(PMSG_POWEROFF) && !dpm_suspend_end(PMSG_POWEROFF))
return;
pr_emerg("Failed to power off devices, using shutdown instead.\n");
@@ -1112,6 +1113,13 @@ static ssize_t hw_protection_store(struct kobject *kobj,
static struct kobj_attribute hw_protection_attr = __ATTR_RW(hw_protection);
#endif
+static int __init shutdown_setup(char *str)
+{
+ shutdown_legacy = true;
+ return 1;
+}
+__setup("shutdown=legacy", shutdown_setup);
+
static int __init reboot_setup(char *str)
{
for (;;) {
--
2.53.0
next prev parent reply other threads:[~2026-11-02 13:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 13:54 [PATCH 0/2] Use hibernate callbacks when shutting down the system Mario Limonciello
2026-11-02 13:54 ` [PATCH 1/2] PM: Use hibernation callbacks for system power off Mario Limonciello
2026-11-02 13:54 ` Mario Limonciello [this message]
2026-11-02 17:17 ` [PATCH 2/2] PM: Add shutdown=legacy command line option Randy Dunlap
2026-11-02 17:36 ` Mario Limonciello
2026-11-06 16:57 ` [PATCH 0/2] Use hibernate callbacks when shutting down the system Rafael J. Wysocki (Intel)
2026-11-06 17:13 ` Mario Limonciello
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=20261102-superm1-s4-at-s5-v1-2-313e0012dd39@kernel.org \
--to=superm1@kernel.org \
--cc=acelan.kao@canonical.com \
--cc=bartualev@gmail.com \
--cc=benato.denis96@gmail.com \
--cc=corbet@lwn.net \
--cc=kaihengf@nvidia.com \
--cc=lenb@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=m3rthn.k@gmail.com \
--cc=mpearson-lenovo@squebb.ca \
--cc=pavel@kernel.org \
--cc=rafael@kernel.org \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.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®