FS#21944 - [pm-utils] Suspending does not work
Attached to Project:
Arch Linux
Opened by Andrej Podzimek (andrej) - Tuesday, 30 November 2010, 21:57 GMT
Last edited by Andrea Scarpino (BaSh) - Sunday, 16 January 2011, 10:15 GMT
Opened by Andrej Podzimek (andrej) - Tuesday, 30 November 2010, 21:57 GMT
Last edited by Andrea Scarpino (BaSh) - Sunday, 16 January 2011, 10:15 GMT
|
Details
Description:
Suspending the machine using pm-utils and the default ('kernel') functionality does not work. This works just fine: echo -n disk > /sys/power/state This doesn't work: pm-hibernate This means that the power settings widget in KDE cannot suspend the machine. Additional info: * package version(s) pm-utils 1.4.0-1 * config and/or log files etc. This is the most important line in /var/log/pm-suspend.log: /usr/lib/pm-utils/pm-functions: line 316: echo: write error: No such file or directory It is a piece of nonsense, since the /sys/power/state file is (of course) present and 'works' as expected when used manually. The script must see a different filesystem for some reason. Does it unmount/remount the /sys filesystem? That seems to be the only possible explanation. The configuration is very simple: # grep '^[^#]' /etc/pm/config.d/defaults SLEEP_MODULE='kernel' SUSPEND_MODULES=(xhci_hcd) Steps to reproduce: Try to suspend. |
This task depends upon
Closed by Andrea Scarpino (BaSh)
Sunday, 16 January 2011, 10:15 GMT
Reason for closing: Not a bug
Additional comments about closing: user said
Sunday, 16 January 2011, 10:15 GMT
Reason for closing: Not a bug
Additional comments about closing: user said
Anyway, the "resume" hook is unrelated to this issue. Resuming works just fine. Suspending with pm-utils is the only thing that fails. (And consequently, suspending from the KDE menu does not work, since KDE uses pm-utils as well.)
The only question is: How can it happen that the pm-functions script does not see the /sys/power/state file and claims that the file does not exist? This is the obvious cause of the problem. The /sys/power/state file *does* exist on my machine and it works as expected when used directly.
mount > /tmp/SUSPEND_DEBUG 2>&1
echo >> /tmp/SUSPEND_DEBUG
ls -al /sys/power >> /tmp/SUSPEND_DEBUG 2>&1
echo >> /tmp/SUSPEND_DEBUG
cat /sys/power/state >> /tmp/SUSPEND_DEBUG 2>&1
echo >> /tmp/SUSPEND_DEBUG
echo "${HIBERNATE_MODE}" >> /tmp/SUSPEND_DEBUG
And this is the output:
proc on /proc type proc (rw,relatime)
sys on /sys type sysfs (rw,relatime)
udev on /dev type tmpfs (rw,nosuid,relatime,size=10240k,mode=755)
/dev/mapper/octopus-main on / type btrfs (rw,noatime)
devpts on /dev/pts type devpts (rw)
shm on /dev/shm type tmpfs (rw,nosuid,nodev)
/dev/shm on /tmp type none (rw,nosuid,nodev,bind)
/dev/mapper/octopus-main on /etc type btrfs (rw,nosuid,noatime,subvol=etc)
/dev/mapper/octopus-main on /var type btrfs (rw,nosuid,noatime,subvol=var)
/dev/mapper/octopus-main on /home type btrfs (rw,nosuid,noatime,subvol=home)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
gvfs-fuse-daemon on /home/andrej/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=andrej)
/dev/sdc on /media/EasternDigital type btrfs (rw,nosuid,nodev,uhelper=hal)
total 0
drwxr-xr-x 2 root root 0 Dec 6 14:29 .
drwxr-xr-x 12 root root 0 Dec 5 00:35 ..
-rw-r--r-- 1 root root 4096 Dec 7 10:50 disk
-rw-r--r-- 1 root root 4096 Dec 7 10:50 image_size
-rw-r--r-- 1 root root 4096 Dec 7 10:50 pm_async
-rw-r--r-- 1 root root 4096 Dec 7 10:50 pm_test
-rw-r--r-- 1 root root 4096 Dec 5 00:35 resume
-rw-r--r-- 1 root root 4096 Dec 6 14:29 state
-rw-r--r-- 1 root root 4096 Dec 7 10:50 wakeup_count
mem disk
A couple of quick observations:
1) There are two empty lines at the end, which means that $HIBERNATE_MODE is empty.
2) The /sys filesystem is mounted and the 'state' file does exist, despite what 'echo' says.
3) The 'mem' and 'disk' tokens are present in the /sys/power/state file, so everything should work normally.
I also re-checked that suspending with just echo -n disk > /sys/power/state works normally.
It seems like a kernel+particular harwdare (and maybe permission) issue, though. Here are a couple of relevant (perhaps) links:
https://bugs.freedesktop.org/show_bug.cgi?id=31950
https://bugzilla.redhat.com/show_bug.cgi?id=647604
EDIT: Also, just to cover all bases, I would try with SUSPEND_MODULES="" and SLEEP_MODULES="".
The reason why I report this as a bug is pretty simple:
* Suspending works fine with modprobe -r xhci_hcd; echo -n disk > /sys/power/state. (I usually ban the USB 3.0 module anyway, in which case no unloading is needed.)
* Suspending *fails* with pm-utils (and thus with KDE as well).
That's why I think it *is* a pm-utils issue.
SUSPEND_MODULES has to be set to xhci_hcd, since xhci_hcd does not support suspending. As for SLEEP_MODULE, I have neither uswsusp (which IMO does not work for 99% of hardware and it definitely does not work for this machine), nor tuxonice (which used to be great two years ago, but it somehow died). So 'kernel' is the only possible value for SLEEP_MODULE anyway.