[PATCH 0/2] Use hibernate callbacks when shutting down the system

From: Mario Limonciello

Date: Mon Nov 02 2026 - 09:19:16 EST


OEM systems that ship with Linux preloaded need to go through energy
certifications that match regulatory bodies in the regions that they
will ship.

If any of those certifications don't pass then OEMs might not be able
to ship systems preloaded in applicable regions.

Multiple models of systems are reported to fail in Linux but pass
for Windows on the exact same hardware.

By looking at a breakdown of power consumption across devices the
issue is that some devices aren't turned off when user puts the
system into S5 (shutdown).

A few years ago when I first root caused this I submitted patches
to PCI core to change the PCI policy at shutdown [1].

But through various iterations I've come up with a better approach.
Instead of changing policy in each subsystem we can instead
change our shutdown command to run hibernate callbacks for all hardware.

In order to accomplish that the last 17 kernel cycles I've been slowly
drippping changes into the hibernate code paths of all subsystems to make
sure they behave as intended.

Those are all merged as of kernel 7.4-rc1, and thus I am now ready to
start using the hibernate codepath at shutdown. This series adds that
support.

I'm not naïve; there is definitely risk involved with this change as it
will essentially affect anything running Linux that gets turned off.

To that I will say that I have been running, rebasing and iterating this
series on my personal development tree ever since December 2023.
Various rolling distro community members have also been testing iterations
of these patches in their hardware and distros.

I've also put a few guard rails in place:

1. Don't mandate hibernate support. If not compiled with it, just use
previous shutdown paths.
2. If hibernate callback fail, emit a `pr_emerg()` message but fallback
to previous shutdown paths.
3. Offer a kernel command line option `shutdown=legacy` that any affected
user could use to roll back to previous behavior while we root cause
any issues.

I did split out the kernel command line option to a second commit. If we
later decide that we want to keep this behavior but drop the rollback knob
we can revert that commit.

Link: https://lore.kernel.org/linux-pci/20231213182656.6165-1-mario.limonciello@xxxxxxx/#t

Signed-off-by: Mario Limonciello <superm1@xxxxxxxxxx>
---
Mario Limonciello (2):
PM: Use hibernation callbacks for system power off
PM: Add shutdown=legacy command line option

Documentation/admin-guide/kernel-parameters.txt | 4 ++++
Documentation/power/shutdown-debugging.rst | 7 ++++++-
kernel/reboot.c | 16 ++++++++++++++++
3 files changed, 26 insertions(+), 1 deletion(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261006-superm1-s4-at-s5-f55b441d6c5b

Best regards,
--
Mario Limonciello <superm1@xxxxxxxxxx>