s2ram.txt 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. How to get s2ram working
  2. ~~~~~~~~~~~~~~~~~~~~~~~~
  3. 2006 Linus Torvalds
  4. 2006 Pavel Machek
  5. 1) Check suspend.sf.net, program s2ram there has long whitelist of
  6. "known ok" machines, along with tricks to use on each one.
  7. 2) If that does not help, try reading tricks.txt and
  8. video.txt. Perhaps problem is as simple as broken module, and
  9. simple module unload can fix it.
  10. 3) You can use Linus' TRACE_RESUME infrastructure, described below.
  11. Using TRACE_RESUME
  12. ~~~~~~~~~~~~~~~~~~
  13. I've been working at making the machines I have able to STR, and almost
  14. always it's a driver that is buggy. Thank God for the suspend/resume
  15. debugging - the thing that Chuck tried to disable. That's often the _only_
  16. way to debug these things, and it's actually pretty powerful (but
  17. time-consuming - having to insert TRACE_RESUME() markers into the device
  18. driver that doesn't resume and recompile and reboot).
  19. Anyway, the way to debug this for people who are interested (have a
  20. machine that doesn't boot) is:
  21. - enable PM_DEBUG, and PM_TRACE
  22. - use a script like this:
  23. #!/bin/sh
  24. sync
  25. echo 1 > /sys/power/pm_trace
  26. echo mem > /sys/power/state
  27. to suspend
  28. - if it doesn't come back up (which is usually the problem), reboot by
  29. holding the power button down, and look at the dmesg output for things
  30. like
  31. Magic number: 4:156:725
  32. hash matches drivers/base/power/resume.c:28
  33. hash matches device 0000:01:00.0
  34. which means that the last trace event was just before trying to resume
  35. device 0000:01:00.0. Then figure out what driver is controlling that
  36. device (lspci and /sys/devices/pci* is your friend), and see if you can
  37. fix it, disable it, or trace into its resume function.
  38. If no device matches the hash (or any matches appear to be false positives),
  39. the culprit may be a device from a loadable kernel module that is not loaded
  40. until after the hash is checked. You can check the hash against the current
  41. devices again after more modules are loaded using sysfs:
  42. cat /sys/power/pm_trace_dev_match
  43. For example, the above happens to be the VGA device on my EVO, which I
  44. used to run with "radeonfb" (it's an ATI Radeon mobility). It turns out
  45. that "radeonfb" simply cannot resume that device - it tries to set the
  46. PLL's, and it just _hangs_. Using the regular VGA console and letting X
  47. resume it instead works fine.
  48. NOTE
  49. ====
  50. pm_trace uses the system's Real Time Clock (RTC) to save the magic number.
  51. Reason for this is that the RTC is the only reliably available piece of
  52. hardware during resume operations where a value can be set that will
  53. survive a reboot.
  54. pm_trace is not compatible with asynchronous suspend, so it turns
  55. asynchronous suspend off (which may work around timing or
  56. ordering-sensitive bugs).
  57. Consequence is that after a resume (even if it is successful) your system
  58. clock will have a value corresponding to the magic number instead of the
  59. correct date/time! It is therefore advisable to use a program like ntp-date
  60. or rdate to reset the correct date/time from an external time source when
  61. using this trace option.
  62. As the clock keeps ticking it is also essential that the reboot is done
  63. quickly after the resume failure. The trace option does not use the seconds
  64. or the low order bits of the minutes of the RTC, but a too long delay will
  65. corrupt the magic value.