# No input devices on return from hibernation

## Tony0945

On return from hibernation, the screen is shown with the programs that were running when hibernating, i.e. two terminals and Firefox. No mouse, no keyboard and can't ssh in from another PC on the LAN. Screen looks great though.

Kernel 4.0.5, tried both gentoo-sources and tuxonice-sources. OpenRC eudev xdm & Mate.  Nouveau driver on EVGA GeForce 8400GS video card.

Mobo 	Gigabyte GA-880GA-UD3H

CPU	        Socket M3 Phenom II X6 1090T

Memory	8G  DDR3

Followed seven year  old wiki howto on tuxonice.  rtcwake works with -m off, but with -m at mem or disk, the same thing happens.

Dual booting with XP. Hibernation and Standy work fine with XP, so the hardware is capable.

Any advice on how to troubleshoot this?   Any data that I can provide?

----------

## eccerr0r

A lot of these problems are motherboard specific unfortunately as there aren't a whole bunch of options...  Plus unless Gigabyte is Linux friendly, since Windows works, they won't care about Linux...  Are you using the latest BIOS?

So the computer looks completely dead on resume except the screen is like it was before suspend?  Are the keyboard LEDs flashing if you have a PS/2 keyboard?

I suppose suspend works properly however?

Are the two kernel sources you used both 4.0.5?  Tried a different version (3.x perhaps?)

(Speaking from a "works for me" perspective... though I have not upgraded to 4.0.5 yet.  I'm still using a 3.1x era Gentoo-sources which works for my machines.)

----------

## Tony0945

Yes, I'm using the latest BIOS which is several years old.

I have a PS/2 keyboard. On resume, no lights at all. Although the BIOS is set to resume on any keypress r mouse double-click, neither works. I restart by power button, just a quick press, when four seconds is supposed to be required for reboot.  Tuxonice actually asks me if I want to resume (press keybar) or cancel (Press C). I press the key bar but that's the last time it responds. Either with or without tuxonice, the keyboard works to continue booting until the screen comes up.

Both kernel sources were 4.0.5.  I have just tried with 3.19.0 and it is even uglier. The boot process stops and the screen goes green.

Heres the grub lines: *Quote:*   

> #
> 
> title=Gentoo Linux (4.0.5-tuxonice)
> 
> root (hd1,0)
> ...

 

Here is the output of acpitool -e 

```
  Kernel version : 4.1.0-gentoo   -    ACPI version : 20150410

  -----------------------------------------------------------

  Battery status : <not available>

  AC adapter     : <info not available or off-line> 

  Fan            : <not available>

  CPU type               : AMD Phenom(tm) II X6 1090T Processor 

  Min/Max frequency      : 800/3200 MHz

  Current frequency      : 800 MHz

  Frequency governor     : ondemand 

  Freq. scaling driver   : acpi-cpufreq 

  Cache size             : 800.000 KB

  Bogomips               : 6428.43 

  Bogomips               : 6428.43 

  Bogomips               : 6428.43 

  Bogomips               : 6428.43 

  Bogomips               : 6428.43 

  Bogomips               : 6428.43 

  Function Show_CPU_Info : could not read directory /proc/acpi/processor/

  Make sure your kernel has ACPI processor support enabled.

  Thermal info   : <not available>

   Device   S-state     Status   Sysfs node

  ---------------------------------------

  1. PCI0     S5   *disabled  no-bus:pci0000:00

  2. USB0     S3   *enabled   pci:0000:00:12.0

  3. USB1     S3   *enabled   pci:0000:00:12.2

  4. USB2     S3   *enabled   pci:0000:00:13.0

  5. USB3     S3   *enabled   pci:0000:00:13.2

  6. USB4     S3   *enabled   pci:0000:00:16.0

  7. USB5     S3   *enabled   pci:0000:00:16.2

  8. USB6     S3   *enabled   pci:0000:00:14.5

  9. SBAZ     S4   *disabled  pci:0000:00:14.2

  10. PEX0     S5   *disabled  pci:0000:00:15.0

  11. PEX1     S5   *disabled  pci:0000:00:15.1

  12. PEX2     S5   *disabled

  13. PEX3     S5   *disabled

  14. P2P     S5   *disabled  pci:0000:00:14.4

  15. PCE2     S4   *disabled  pci:0000:00:02.0

  16. PCE3     S4   *disabled

  17. PCE4     S4   *disabled

  18. PCE5     S4   *disabled

  19. PCE6     S4   *disabled

  20. PCE7     S4   *disabled

  21. PCE9     S4   *disabled  pci:0000:00:09.0

  22. PCEA     S4   *disabled  pci:0000:00:0a.0

  23. PCEB     S4   *disabled

  24. PCEC     S4   *disabled

  25. PS2M     S5   *disabled

  26. PS2K     S5   *disabled

```

And the kernel params are here (4.0.5 tuxonice) https://bpaste.net/show/d7e2ce25d86b

----------

## eccerr0r

I've never used tuxonice, just the built-in which seems to hibernate just fine...  I'm kind of confused which variations you're using, and unfortunately I don't know if tuxonice has any recent issues with recent machines or not.

The in-kernel hibernate goes completely to S5 so you will need to use the power switch to resume.  Also the in-kernel hibernate does not accept any keyboard commands from when it starts loading the image (optionally, in initramfs, unless the spacebar/etc cmd is taken from initramfs instead of the kernel) until restore state completes... so I suspect all your experiments were on tuxonice?

----------

## Tony0945

No, tuxonice was the last thing I tried.  I did get rtcwake going by adding the acpi_osi=linux parameter to the boot file. I have another system, pure Gentoo that has an MSI board that will neither hibernate/suspend nor rtcwake. It will wake on lan, although that took a bit of work too. I thought it easiest to start with the computer that does do all those things with Windows. 

I'm rather bothered by that "Function Show_CPU_Info : could not read directory /proc/acpi/processor/

  Make sure your kernel has ACPI processor support enabled. " from acpitools. AFAIK, it IS enabled in the kernel. Perhaps I need to force it on the command line?

----------

## eccerr0r

For software hibernation in Linux, I don't think it actually needs firmware/ACPI support.  S3 suspend, however, ACPI firmware support is necessary.

For recent versions of Linux I've found most of my boards/machines work just fine with the in-kernel hibernate-to-disk.  The problematic components tends to be the video card for closed source, but since you're using nouveau it should work.  Most of my machines are using Intel video, unsure if more regression testing by the kernel devs were done on this hardware set...

The error you're getting may be due to the acpitool being out of date, as most of this data migrated from /proc/acpi to /sys somewhere... You can enable "legacy acpi /proc/acpi" support in the kernel to make it show up.

I'd want to make sure you're seeing a complete hang versus all your input devices are dead upon resume... Can you ascertain that? (perhaps run some animated gif before hibernating?)

----------

## Tony0945

A very good suggestion, eccerr0r!    Running kernel 4.0.5, gentoo-sources, not tuxonice, I ran a video in xine, with the sound on. On return from s2ram, the video was frozen with no sound.

On return from s2disk, it appeared to be a normal boot. I had to log in and there was no trace of the xine or terminal windows.

----------

## eccerr0r

Ok it looks like your machine is totally hanging.  Can you suspend to ram when not in graphics mode?  Run 'top' or something once again that changes.

It looks like your suspend to disk (or at least the resume part) is not setup properly...hmm...  in-kernel resume from hibernation requires resume=/dev/sdb2, might need to add that along with real_resume (is this a "real" option?), tuxonice_resume.

----------

## Tony0945

I found this troubleshooting guide:https://www.kernel.org/doc/Documentation/power/basic-pm-debugging.txt

I ran the tests and everything was fine. the computer shutdown and came back five seconds later with no trouble, but won't from s2ram or s2disk.

After yet another unsuccesful attempt, I found this in /var/log/debug *Quote:*   

> Jun 27 10:34:44 CASTI kernel: pci 0000:01:00.0: Video device with shadowed ROM
> 
> Jun 27 10:34:44 CASTI kernel: PCI: CLS 4 bytes, default 64
> 
> Jun 27 10:34:44 CASTI kernel: ahci 0000:00:11.0: version 3.0
> ...

 

Thinking that maybe the kernel can't compress my 8GB memory into a 2GB partition, I switched to a swap file with this grub line: *Quote:*   

> title=Gentoo Linux (4.0.6-gentoo)
> 
> root (hd1,0)
> 
> kernel /kernel-genkernel-x86_64-4.0.6-gentoo vga=0x314 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sdb3  resume=/dev/sdb3 real_resume=/dev/sdb3 resume offset = 29044736 acpi_osi=Linux agp=off 
> ...

 

Upon reboot: *Quote:*   

> Jun 27 15:25:22 CASTI kernel: PCI: CLS 4 bytes, default 64
> 
> Jun 27 15:25:22 CASTI kernel: ahci 0000:00:11.0: version 3.0
> 
> Jun 27 15:25:22 CASTI kernel: PM: Checking hibernation image partition /dev/sdb3
> ...

 

Wish I knew what code -22 meant.

----------

## eccerr0r

Make sure it's resume_offset=xxxx without spaces...

----------

## Tony0945

 *eccerr0r wrote:*   

> Make sure it's resume_offset=xxxx without spaces...

 

Good catch! But fixing that didn't help either. I delved into the kernel code and found the -22 was really -EINVAL. Then I put a pr_debug statement at every return of EINVAL to see what was triggering it. Here's from the latest /var/log/debug: *Quote:*   

> Jun 28 10:31:35 CASTI kernel: PM: Checking hibernation image partition /dev/sdb2
> 
> Jun 28 10:31:35 CASTI kernel: sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
> 
> Jun 28 10:31:35 CASTI kernel: sd 3:0:0:0: [sdc] Mode Sense: 00 3a 00 00
> ...

 

Major 8, minor 18 is indeed /dev/sdb2. I changed back to swap partition from sawpfile when I found that I am actually using 675M of my 8G memory which should fit on the 1.9G swap partition even without compression.

It would appear that s2disk should be writing a signature (or is it the kernel?) but is failing to do so.

----------

## eccerr0r

I'd suppose the signature for the different versions of suspend (tuxonice, default in-kernel, etc.) needs to match the same version as you hibernated on.  Make sure you don't have them mixed up (can't resume a tuxonice image with in-kernel hibernate, etc.)

Perhaps it was an old suspend experiment that still had the signature written but never got cleared from a successful resume?

----------

## Tony0945

After examining the source code for suspend-1.0 and kernel/power/swap.c, I concluded that the signatures were incompatible. I switched to the later hibernate-script package which resulted in: *Quote:*   

> Jun 30 16:48:44 CASTI kernel: PM: Hibernation image partition 8:18 present
> 
> Jun 30 16:48:44 CASTI kernel: PM: Looking for hibernation image.
> 
> Jun 30 16:48:44 CASTI kernel: PM: ERROR - wrong signature should be S1SUSPEND but is ULSUSPEND  at line 1471 file kernel/power/swap.c
> ...

 

i.e. the kernel is looking for the S1SUSPEND signature but the script is providing ULSUSPEND (userland suspend?).  I followed the Arch wiki because there was newer stuff there. After reading the numerous warnings about trashing my drive, I decided to quit poking at it without real knowledge of how this is supposed to work and move on to a more rewarding project.

Many thanks to eccerr0r for helping me.

----------

## eccerr0r

I think you should simply stick with one suspend/resume implementation and dont bother with the others.  I personally use the in-kernel one (i.e., not user land suspend, not tuxonice) because I am lazy and no patches are needed, and with current pm-utils/consolekit/systemd, it "just works."  I haven't had too many complaints about it, as I do have several machines which work (finally!) - I have had problems with it in the past however, and still have occasional problems currently - as hinted, it's the closed source video card driver that bites the most.  I think my i7 desktop with RadeonHD desktop fails to come out of suspend-to-ram about 1 out of 5 times, which unfortunately is too much for me to use.  As it is a systemd/ssd machine, boot times are negligible, I just power down the machine and don't bother with suspend.

The first machine I found it to work "just fine" was my eeePC.  This started the quest for me to finally enable it and get it working for all of my other machines/laptops mixture between xfce4/gnome3, both openrc and systemd.

----------

## Tony0945

I note a new symptom. I dual boot with Windows XP. Now that i am readily putting XP into standby I note that although a key press or mouse click will return the computer from suspensiom, they are inoperative after return. they are revided by unplugging and replugging the USB connectors, so maybe it's a BIOS problem?

----------

