How to debug suspend?

Solution 1:

From https://wiki.ubuntu.com/UnderstandingSuspend

  • Biggest problem is graphics hardware
  • try suspend without restricted devices (nvidia, fglrx)
  • kernel doesn't know how to handle graphical devices
  • BIOS knows how to restore graphics state
    • via 16 bit segmented mode, C000:xxxx contains the visible 64k video ROM.
    • starting execution at C000:0003, normally re-POSTs the video BIOS (/usr/sbin/vbetool post)
      • more difficult in 64bit mode, since 16bit calls need to be emulated.
      • some memory is in 3-4G range, which requires remapping when emulating to avoid hitting the kernel which is mapped in the same space. o video BIOS may have paged POST code out of C000 window o nvidia BIOS rewrites ROM to just return to stop re-POSTing try suspend from console (via /etc/acpi/sleep.sh)
    • make sure you're logged out of Xorg (or run sleep.sh with "force" argument)
    • if the video BIOS isn't left in a sane state, returning to Xorg may hang the hardware
    • tests capslock on resume (if no capslock, kernel hung)
    • if backlight doesn't come back on, video BIOS probably didn't reinitialize
    • if screen is blank, but has a backlight, try hitting enter or switching between virtual terminals
    • try in single-user mode (via appending "single" to the grub kernel boot options)
    • for details on actions, try bash -x /etc/acpi/sleep.sh >/root/sleep.log 2>&1
    • look at dmidecode information that matches settings in /usr/share/acpi-support/*.config
    • if single-user mode console suspend or resume fails
    • PM trace (echo "1" > /sys/power/pm_trace) which will write device hashes to the system timer
    • attempt to suspend
    • after the failure, on reboot, examine the dmesg output for "device hash" entries to track down the device that hung the system during resume.
    • aware that this will reset the system clock, and fsck will freak out ("has gone without a fsck for 31337 days"). consider tune2fs -c 0 /dev/your/filesystems.

Solution 2:

You can find a lot of guidelines/advices here and here.

From your description, it sounds as if your ACPI is not working properly, or the kernel drivers are preventing a full suspend. The second link shows how to deal with that kind of problem.