Score:1

Mouse movement wakes system up from sleep if the USB adapter is not reconnected

es flag

I have /etc/udev/rules.d/99-wakeup.rules to disable wakeup from sleep when using a keyboard or mouse connected to the device:

ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="0a81", ATTRS{idProduct}=="0205", ATTR{power/wakeup}="disabled"

The USB device is

$ lsusb | grep 0205
Bus 001 Device 006: ID 0a81:0205 Chesen Electronics Corp. PS/2 Keyboard+Mouse Adapter

I added GRUB_CMDLINE_LINUX="udev.log-priority=debug" in /etc/default/grub and ran sudo update-grub to increase log level. Rebooted and ran

$ LC_ALL=C journalctl -b0 -u systemd-udevd | grep -F /etc/udev/rules.d/99-wakeup.rules
Nov 06 03:13:46 jarnos-OptiPlex-9010 systemd-udevd[341]: Reading rules file: /etc/udev/rules.d/99-wakeup.rules
Nov 06 03:13:47 jarnos-OptiPlex-9010 systemd-udevd[349]: 1-1.1.1: /etc/udev/rules.d/99-wakeup.rules:14 ATTR '/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.1/power/wakeup' writing 'disabled'
Nov 06 03:13:47 jarnos-OptiPlex-9010 systemd-udevd[375]: 1-1.1.1:1.1: /etc/udev/rules.d/99-wakeup.rules:14 ATTR '/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.1/1-1.1.1:1.1/power/wakeup' writing 'disabled'
Nov 06 03:13:47 jarnos-OptiPlex-9010 systemd-udevd[375]: 1-1.1.1:1.1: /etc/udev/rules.d/99-wakeup.rules:14 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.1/1-1.1.1:1.1/power/wakeup}, ignoring: No such file or directory
Nov 06 03:13:47 jarnos-OptiPlex-9010 systemd-udevd[349]: 1-1.1.1:1.0: /etc/udev/rules.d/99-wakeup.rules:14 ATTR '/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.1/1-1.1.1:1.0/power/wakeup' writing 'disabled'
Nov 06 03:13:47 jarnos-OptiPlex-9010 systemd-udevd[349]: 1-1.1.1:1.0: /etc/udev/rules.d/99-wakeup.rules:14 Failed to write ATTR{/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.1/1-1.1.1:1.0/power/wakeup}, ignoring: No such file or directory

But after reboot

$ cat /sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.1/power/wakeup
enabled

What changes it to "enabled"? Even mouse movement wakes system up from sleep. However, if I reconnect the adapter after boot, the value becomes "disabled". I expect the rule be effective in startup, too. If this is a bug, against which package this should be reported?

I can work this issue around by writing enabled in /sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1.1/power/wakeup before entering system suspend possibly automatically (see man systemd-sleep).

user.dz avatar
ng flag
Try update ramdisk/ramfs using `sudo update-initramfs -u` , test it with reboot. If it doesn't work, you may also add another rule for `ACTION=="change"` it could be that it got refreshed at some point later.
user.dz avatar
ng flag
Also there are some BIOS systems that allow disabling it globally (based on port, not device). Because this option to work, motherboard need to keep USB ports alive. (some even list it as power saving option)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.