Kernel Patches Test Suspend States at Runtime
Two patches by Rafael J. Wysocki give users the ability to test suspend and hibernation modes at runtime to detect errors.
The first patch gives users the ability to test the suspend code (suspend to disk) without actually switching to suspend mode. This is a useful approach to discovering driver issues says the developer. The second patch modifies the current hibernation function (Suspend to RAM) source code to achieve the same objective. According to Wysocki, this works better than the current test modes as his code can also test globabl ACPI methods.
The test options add a new "/sys/power/pm_test_level" attribute which accepts numbers between 1 and 5. Each of these values simulates a different suspend or hibernation code level. Wysocki explains the individual values as follows. 5 test the freezing of individual processes. 4 additionally tests suspending of devices. Besides suspending processes and devices, 3 additionally tests platform global methods. 2 adds disabling of nonboot CPUs, and 1 simulates full system suspend.
The developer adds: "if a suspend is started by normal means, the suspend core will perform its normal operations up to the point indicated by the test level. Next, it will wait for 5 seconds and carry out the resume operations needed to transition the system back to the fully functional state". To avoid using the text system, you can set "pm_test_level" to 0. Wysocki’s third patch adds information on his test systems to the documentation.
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

News
-
First Release Candidate for Linux Kernel 6.14 Now Available
Linus Torvalds has officially released the first release candidate for kernel 6.14 and it includes over 500,000 lines of modified code, making for a small release.
-
System76 Refreshes Meerkat Mini PC
If you're looking for a small form factor PC powered by Linux, System76 has exactly what you need in the Meerkat mini PC.
-
Gnome 48 Alpha Ready for Testing
The latest Gnome desktop alpha is now available with plenty of new features and improvements.
-
Wine 10 Includes Plenty to Excite Users
With its latest release, Wine has the usual crop of bug fixes and improvements, along with some exciting new features.
-
Linux Kernel 6.13 Offers Improvements for AMD/Apple Users
The latest Linux kernel is now available, and it includes plenty of improvements, especially for those who use AMD or Apple-based systems.
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.