Blame view
Documentation/power/drivers-testing.rst
2.29 KB
151f4e2bd docs: power: conv... |
1 |
==================================================== |
5b7952021 Documentation: As... |
2 |
Testing suspend and resume support in device drivers |
151f4e2bd docs: power: conv... |
3 |
==================================================== |
5b7952021 Documentation: As... |
4 5 6 |
(C) 2007 Rafael J. Wysocki <rjw@sisk.pl>, GPL 1. Preparing the test system |
151f4e2bd docs: power: conv... |
7 |
============================ |
5b7952021 Documentation: As... |
8 9 10 11 |
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 |
ce2b7147b PM: Suspend/hiber... |
12 13 14 |
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 |
5b7952021 Documentation: As... |
15 16 17 18 19 |
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 |
151f4e2bd docs: power: conv... |
20 |
testing the new driver. Please see Documentation/power/basic-pm-debugging.rst |
5e3c3ac9d Fix wrong filenam... |
21 |
for more information about the debugging of suspend/resume functionality. |
5b7952021 Documentation: As... |
22 23 |
2. Testing the driver |
151f4e2bd docs: power: conv... |
24 |
===================== |
5b7952021 Documentation: As... |
25 26 27 |
Once you have resolved the suspend/resume-related problems with your test system without the new driver, you are ready to test it: |
ce2b7147b PM: Suspend/hiber... |
28 |
a) Build the driver as a module, load it and try the test modes of hibernation |
151f4e2bd docs: power: conv... |
29 |
(see: Documentation/power/basic-pm-debugging.rst, 1). |
5b7952021 Documentation: As... |
30 |
|
ce2b7147b PM: Suspend/hiber... |
31 |
b) Load the driver and attempt to hibernate in the "reboot", "shutdown" and |
151f4e2bd docs: power: conv... |
32 |
"platform" modes (see: Documentation/power/basic-pm-debugging.rst, 1). |
5b7952021 Documentation: As... |
33 |
|
ce2b7147b PM: Suspend/hiber... |
34 35 |
c) Compile the driver directly into the kernel and try the test modes of hibernation. |
5b7952021 Documentation: As... |
36 |
|
ce2b7147b PM: Suspend/hiber... |
37 38 |
d) Attempt to hibernate with the driver compiled directly into the kernel in the "reboot", "shutdown" and "platform" modes. |
5b7952021 Documentation: As... |
39 |
|
1992b66d2 PM: Wrap document... |
40 41 42 43 |
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.] |
ce2b7147b PM: Suspend/hiber... |
44 45 |
f) Attempt to suspend to RAM using the s2ram tool with the driver loaded |
151f4e2bd docs: power: conv... |
46 |
(see: Documentation/power/basic-pm-debugging.rst, 2). |
5b7952021 Documentation: As... |
47 48 49 50 |
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. |