Back to home page

OSCL-LXR

 
 

    


0001 ====================================================
0002 Testing suspend and resume support in device drivers
0003 ====================================================
0004 
0005         (C) 2007 Rafael J. Wysocki <rjw@sisk.pl>, GPL
0006 
0007 1. Preparing the test system
0008 ============================
0009 
0010 Unfortunately, to effectively test the support for the system-wide suspend and
0011 resume transitions in a driver, it is necessary to suspend and resume a fully
0012 functional system with this driver loaded.  Moreover, that should be done
0013 several times, preferably several times in a row, and separately for hibernation
0014 (aka suspend to disk or STD) and suspend to RAM (STR), because each of these
0015 cases involves slightly different operations and different interactions with
0016 the machine's BIOS.
0017 
0018 Of course, for this purpose the test system has to be known to suspend and
0019 resume without the driver being tested.  Thus, if possible, you should first
0020 resolve all suspend/resume-related problems in the test system before you start
0021 testing the new driver.  Please see Documentation/power/basic-pm-debugging.rst
0022 for more information about the debugging of suspend/resume functionality.
0023 
0024 2. Testing the driver
0025 =====================
0026 
0027 Once you have resolved the suspend/resume-related problems with your test system
0028 without the new driver, you are ready to test it:
0029 
0030 a) Build the driver as a module, load it and try the test modes of hibernation
0031    (see: Documentation/power/basic-pm-debugging.rst, 1).
0032 
0033 b) Load the driver and attempt to hibernate in the "reboot", "shutdown" and
0034    "platform" modes (see: Documentation/power/basic-pm-debugging.rst, 1).
0035 
0036 c) Compile the driver directly into the kernel and try the test modes of
0037    hibernation.
0038 
0039 d) Attempt to hibernate with the driver compiled directly into the kernel
0040    in the "reboot", "shutdown" and "platform" modes.
0041 
0042 e) Try the test modes of suspend (see:
0043    Documentation/power/basic-pm-debugging.rst, 2).  [As far as the STR tests are
0044    concerned, it should not matter whether or not the driver is built as a
0045    module.]
0046 
0047 f) Attempt to suspend to RAM using the s2ram tool with the driver loaded
0048    (see: Documentation/power/basic-pm-debugging.rst, 2).
0049 
0050 Each of the above tests should be repeated several times and the STD tests
0051 should be mixed with the STR tests.  If any of them fails, the driver cannot be
0052 regarded as suspend/resume-safe.