]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - Documentation/power/drivers-testing.rst
Merge v5.7-rc1 into drm-misc-fixes
[mirror_ubuntu-hirsute-kernel.git] / Documentation / power / drivers-testing.rst
CommitLineData
151f4e2b 1====================================================
5b795202 2Testing suspend and resume support in device drivers
151f4e2b
MCC
3====================================================
4
5b795202
RW
5 (C) 2007 Rafael J. Wysocki <rjw@sisk.pl>, GPL
6
71. Preparing the test system
151f4e2b 8============================
5b795202
RW
9
10Unfortunately, to effectively test the support for the system-wide suspend and
11resume transitions in a driver, it is necessary to suspend and resume a fully
12functional system with this driver loaded. Moreover, that should be done
ce2b7147
RW
13several times, preferably several times in a row, and separately for hibernation
14(aka suspend to disk or STD) and suspend to RAM (STR), because each of these
15cases involves slightly different operations and different interactions with
5b795202
RW
16the machine's BIOS.
17
18Of course, for this purpose the test system has to be known to suspend and
19resume without the driver being tested. Thus, if possible, you should first
20resolve all suspend/resume-related problems in the test system before you start
151f4e2b 21testing the new driver. Please see Documentation/power/basic-pm-debugging.rst
5e3c3ac9 22for more information about the debugging of suspend/resume functionality.
5b795202
RW
23
242. Testing the driver
151f4e2b 25=====================
5b795202
RW
26
27Once you have resolved the suspend/resume-related problems with your test system
28without the new driver, you are ready to test it:
29
ce2b7147 30a) Build the driver as a module, load it and try the test modes of hibernation
151f4e2b 31 (see: Documentation/power/basic-pm-debugging.rst, 1).
5b795202 32
ce2b7147 33b) Load the driver and attempt to hibernate in the "reboot", "shutdown" and
151f4e2b 34 "platform" modes (see: Documentation/power/basic-pm-debugging.rst, 1).
5b795202 35
ce2b7147
RW
36c) Compile the driver directly into the kernel and try the test modes of
37 hibernation.
5b795202 38
ce2b7147
RW
39d) Attempt to hibernate with the driver compiled directly into the kernel
40 in the "reboot", "shutdown" and "platform" modes.
5b795202 41
1992b66d
BH
42e) Try the test modes of suspend (see:
43 Documentation/power/basic-pm-debugging.rst, 2). [As far as the STR tests are
44 concerned, it should not matter whether or not the driver is built as a
45 module.]
ce2b7147
RW
46
47f) Attempt to suspend to RAM using the s2ram tool with the driver loaded
151f4e2b 48 (see: Documentation/power/basic-pm-debugging.rst, 2).
5b795202
RW
49
50Each of the above tests should be repeated several times and the STD tests
51should be mixed with the STR tests. If any of them fails, the driver cannot be
52regarded as suspend/resume-safe.