2019-06-13 18:10:36 +08:00
|
|
|
====================================================
|
2007-05-08 15:24:07 +08:00
|
|
|
Testing suspend and resume support in device drivers
|
2019-06-13 18:10:36 +08:00
|
|
|
====================================================
|
|
|
|
|
2007-05-08 15:24:07 +08:00
|
|
|
(C) 2007 Rafael J. Wysocki <rjw@sisk.pl>, GPL
|
|
|
|
|
|
|
|
1. Preparing the test system
|
2019-06-13 18:10:36 +08:00
|
|
|
============================
|
2007-05-08 15:24:07 +08:00
|
|
|
|
|
|
|
Unfortunately, to effectively test the support for the system-wide suspend and
|
|
|
|
resume transitions in a driver, it is necessary to suspend and resume a fully
|
|
|
|
functional system with this driver loaded. Moreover, that should be done
|
2007-11-20 06:43:34 +08:00
|
|
|
several times, preferably several times in a row, and separately for hibernation
|
|
|
|
(aka suspend to disk or STD) and suspend to RAM (STR), because each of these
|
|
|
|
cases involves slightly different operations and different interactions with
|
2007-05-08 15:24:07 +08:00
|
|
|
the machine's BIOS.
|
|
|
|
|
|
|
|
Of course, for this purpose the test system has to be known to suspend and
|
|
|
|
resume without the driver being tested. Thus, if possible, you should first
|
|
|
|
resolve all suspend/resume-related problems in the test system before you start
|
2019-06-13 18:10:36 +08:00
|
|
|
testing the new driver. Please see Documentation/power/basic-pm-debugging.rst
|
2007-10-17 14:30:18 +08:00
|
|
|
for more information about the debugging of suspend/resume functionality.
|
2007-05-08 15:24:07 +08:00
|
|
|
|
|
|
|
2. Testing the driver
|
2019-06-13 18:10:36 +08:00
|
|
|
=====================
|
2007-05-08 15:24:07 +08:00
|
|
|
|
|
|
|
Once you have resolved the suspend/resume-related problems with your test system
|
|
|
|
without the new driver, you are ready to test it:
|
|
|
|
|
2007-11-20 06:43:34 +08:00
|
|
|
a) Build the driver as a module, load it and try the test modes of hibernation
|
2019-06-13 18:10:36 +08:00
|
|
|
(see: Documentation/power/basic-pm-debugging.rst, 1).
|
2007-05-08 15:24:07 +08:00
|
|
|
|
2007-11-20 06:43:34 +08:00
|
|
|
b) Load the driver and attempt to hibernate in the "reboot", "shutdown" and
|
2019-06-13 18:10:36 +08:00
|
|
|
"platform" modes (see: Documentation/power/basic-pm-debugging.rst, 1).
|
2007-05-08 15:24:07 +08:00
|
|
|
|
2007-11-20 06:43:34 +08:00
|
|
|
c) Compile the driver directly into the kernel and try the test modes of
|
|
|
|
hibernation.
|
2007-05-08 15:24:07 +08:00
|
|
|
|
2007-11-20 06:43:34 +08:00
|
|
|
d) Attempt to hibernate with the driver compiled directly into the kernel
|
|
|
|
in the "reboot", "shutdown" and "platform" modes.
|
2007-05-08 15:24:07 +08:00
|
|
|
|
2019-11-19 22:09:23 +08:00
|
|
|
e) Try the test modes of suspend (see:
|
|
|
|
Documentation/power/basic-pm-debugging.rst, 2). [As far as the STR tests are
|
|
|
|
concerned, it should not matter whether or not the driver is built as a
|
|
|
|
module.]
|
2007-11-20 06:43:34 +08:00
|
|
|
|
|
|
|
f) Attempt to suspend to RAM using the s2ram tool with the driver loaded
|
2019-06-13 18:10:36 +08:00
|
|
|
(see: Documentation/power/basic-pm-debugging.rst, 2).
|
2007-05-08 15:24:07 +08:00
|
|
|
|
|
|
|
Each of the above tests should be repeated several times and the STD tests
|
|
|
|
should be mixed with the STR tests. If any of them fails, the driver cannot be
|
|
|
|
regarded as suspend/resume-safe.
|