blob: 7f7a737f7f9fd785deacaf4f3aaaf56d87a21c11 [file] [log] [blame]
Rafael J. Wysocki5b795202007-05-08 00:24:07 -07001Testing suspend and resume support in device drivers
2 (C) 2007 Rafael J. Wysocki <rjw@sisk.pl>, GPL
3
41. Preparing the test system
5
6Unfortunately, to effectively test the support for the system-wide suspend and
7resume transitions in a driver, it is necessary to suspend and resume a fully
8functional system with this driver loaded. Moreover, that should be done
Rafael J. Wysockice2b7142007-11-19 23:43:34 +01009several times, preferably several times in a row, and separately for hibernation
10(aka suspend to disk or STD) and suspend to RAM (STR), because each of these
11cases involves slightly different operations and different interactions with
Rafael J. Wysocki5b795202007-05-08 00:24:07 -070012the machine's BIOS.
13
14Of course, for this purpose the test system has to be known to suspend and
15resume without the driver being tested. Thus, if possible, you should first
16resolve all suspend/resume-related problems in the test system before you start
Ralf Baechle5e3c3ac2007-10-16 23:30:18 -070017testing the new driver. Please see Documentation/power/basic-pm-debugging.txt
18for more information about the debugging of suspend/resume functionality.
Rafael J. Wysocki5b795202007-05-08 00:24:07 -070019
202. Testing the driver
21
22Once you have resolved the suspend/resume-related problems with your test system
23without the new driver, you are ready to test it:
24
Rafael J. Wysockice2b7142007-11-19 23:43:34 +010025a) Build the driver as a module, load it and try the test modes of hibernation
26 (see: Documents/power/basic-pm-debugging.txt, 1).
Rafael J. Wysocki5b795202007-05-08 00:24:07 -070027
Rafael J. Wysockice2b7142007-11-19 23:43:34 +010028b) Load the driver and attempt to hibernate in the "reboot", "shutdown" and
29 "platform" modes (see: Documents/power/basic-pm-debugging.txt, 1).
Rafael J. Wysocki5b795202007-05-08 00:24:07 -070030
Rafael J. Wysockice2b7142007-11-19 23:43:34 +010031c) Compile the driver directly into the kernel and try the test modes of
32 hibernation.
Rafael J. Wysocki5b795202007-05-08 00:24:07 -070033
Rafael J. Wysockice2b7142007-11-19 23:43:34 +010034d) Attempt to hibernate with the driver compiled directly into the kernel
35 in the "reboot", "shutdown" and "platform" modes.
Rafael J. Wysocki5b795202007-05-08 00:24:07 -070036
Rafael J. Wysockice2b7142007-11-19 23:43:34 +010037e) Try the test modes of suspend (see: Documents/power/basic-pm-debugging.txt,
38 2). [As far as the STR tests are concerned, it should not matter whether or
39 not the driver is built as a module.]
40
41f) Attempt to suspend to RAM using the s2ram tool with the driver loaded
42 (see: Documents/power/basic-pm-debugging.txt, 2).
Rafael J. Wysocki5b795202007-05-08 00:24:07 -070043
44Each of the above tests should be repeated several times and the STD tests
45should be mixed with the STR tests. If any of them fails, the driver cannot be
46regarded as suspend/resume-safe.