drivers-testing.rst 2.3 KB

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