Firmware Test Suite - s4 test

This test exercises hibernate/resume (S3). The S4 test uses the pm-utils pm-hibernate command to initiate the suspend. By default the test will hibernate the machine and 90 seconds later will use the ACPI wakealarm to automatically resume. One can specify multiple S4 cycles and also specify the delay between initiating each suspend cycle and vary this time between a minimum and maximum time and increasing per cycle by a specified delay delta. This allows one to initiate suspend over a range of times to catch bugs such as wifi re-associating during a suspend.

The test can be used to soak test S4 with various extra options:


Run S4 tests multiple times, e.g. for 10 iterations use: --s3-multiple=10


Check differences between device configurations over a S4 cycle. Note we add a default of 15 seconds to allow wifi to re-associate. Cannot be used with --s4-min-delay, --s4-max-delay and --s4-delay-delta.


Comma separated list of quirk arguments to pass to pm-hibernate.


Sleep N seconds between start of hibernate and wakeup, e.g. --s4-sleep-delay=60. Note that this time needs to include the time taken to hibernate the machine. If it is too short then the wakealarm will fire before the machine is fully hibernate and hence the machine will not automatically wake up.


Minimum time to wait (in integer seconds) before starting next S4 cycle.


Maximum time to wait (in integer seconds) before starting next S4 cycle.


Delta in (seconds) to add to each delay between S4 cycles. When the delay reaches --s4-max-delay then it wraps back around to --s4-min-delay seconds.


sudo fwts s4 - 

..runs one hibernate/resume cycle.

sudo fwts s4 --s4-multiple=50

..run 50 hibernate/resume cycles.

sudo fwts s4 --s4-multiple=100 --s4-min-delay=1 --s4-max-delay=10 --s4-delay-delta=0.25 --s4-sleep-delay=25

..run 100 hibernate/resume cycles, with a range of 1 to 10 seconds between each new hibernate test and trigger the wake up alarm 25 seconds from when each hibernate is initiated. Each iteration adds 0.25 seconds to the delay between each new hibernate test.

Explanation of test results

Certain test results may require a little more explanation. This section will try and give some context to specific test failures.

Error ID



Machine appears to have no swap partition and hence cannot hibernate.


Wakealarm does not seem to work.


When using the --s4-device-check option. Detected a device configuration change between hibernate and resume which may indicate a driver resume fault.


pm-hibernate failed to hibernate the machine and returned error 128.


pm-hibernate failed to put the machine into the S4 (hibernate) state and returned error 129.


pm-hibernate failed to hibernate the machine and returned error 130.


Failed to freeze user space process. A user space program cannot be frozen, which makes S4 abort. It may be worth repeating the S4 test to see how frequent this is. The kernel log may contain information about the user space task that could not be frozen.


Failed to freeze kernel tasks.


Failed to freeze device(s).


Failed to allocate space to construct a hibernate image.


Failed to restore hibernate image.


/sys/kernel/debug/tracing/buffer_size_kb is set too large which may cause hibernate to fail. Programs such as ureadahead may have set this enable fast boot and not freed up the tracing buffer.


Failed to scan the kernel log.

FirmwareTestSuite/Reference/s4 (last edited 2016-01-11 07:24:52 by anthonywong)