Documentation/power/basic-pm-debugging.rst

Source file repositories/reference/linux-study-clean/Documentation/power/basic-pm-debugging.rst

File Facts

System
Linux kernel
Corpus path
Documentation/power/basic-pm-debugging.rst
Extension
.rst
Size
12551 bytes
Lines
270
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

=================================
Debugging hibernation and suspend
=================================

	(C) 2007 Rafael J. Wysocki <rjw@sisk.pl>, GPL

1. Testing hibernation (aka suspend to disk or STD)
===================================================

To check if hibernation works, you can try to hibernate in the "reboot" mode::

	# echo reboot > /sys/power/disk
	# echo disk > /sys/power/state

and the system should create a hibernation image, reboot, resume and get back to
the command prompt where you have started the transition.  If that happens,
hibernation is most likely to work correctly.  Still, you need to repeat the
test at least a couple of times in a row for confidence.  [This is necessary,
because some problems only show up on a second attempt at suspending and
resuming the system.]  Moreover, hibernating in the "reboot" and "shutdown"
modes causes the PM core to skip some platform-related callbacks which on ACPI
systems might be necessary to make hibernation work.  Thus, if your machine
fails to hibernate or resume in the "reboot" mode, you should try the
"platform" mode::

	# echo platform > /sys/power/disk
	# echo disk > /sys/power/state

which is the default and recommended mode of hibernation.

Unfortunately, the "platform" mode of hibernation does not work on some systems
with broken BIOSes.  In such cases the "shutdown" mode of hibernation might
work::

	# echo shutdown > /sys/power/disk
	# echo disk > /sys/power/state

(it is similar to the "reboot" mode, but it requires you to press the power
button to make the system resume).

If neither "platform" nor "shutdown" hibernation mode works, you will need to
identify what goes wrong.

a) Test modes of hibernation
----------------------------

To find out why hibernation fails on your system, you can use a special testing
facility available if the kernel is compiled with CONFIG_PM_DEBUG set.  Then,
there is the file /sys/power/pm_test that can be used to make the hibernation
core run in a test mode.  There are 5 test modes available:

freezer
	- test the freezing of processes

devices
	- test the freezing of processes and suspending of devices

platform
	- test the freezing of processes, suspending of devices and platform
	  global control methods [1]_

processors
	- test the freezing of processes, suspending of devices, platform
	  global control methods [1]_ and the disabling of nonboot CPUs

core
	- test the freezing of processes, suspending of devices, platform global
	  control methods\ [1]_, the disabling of nonboot CPUs and suspending
	  of platform/system devices

Annotation

Implementation Notes