Disable mouse wake-up on newer kernels

From EnigmaGuy Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Problem

There are tons of materials how you can disable mouse wake-up (or rather usb devices wake-up) using file /proc/acpi/wakeup, e.g. Disabling mouse/keyboard wakeup. Unfortunately these tutorials does not work correctly on newer kernels (apprx. ver 3.x.x and higher). There was a change and no matter what is written in /proc/acpi/wakeup, this file is ignored!

Solutions

Newer kernels uses power/wakeup file to prevent device from wakeup, e.g.

root@machine:/sys/devices/pci0000:00/0000...# cat power/wakeup
enabled

So you can easily disable wakeup adding this line to /etc/rc.local

echo disabled > "/sys/devices/pci..usb3/.../power/wakeup"

But how can you find out, which device to block? Try this command for Microsoft mouse...

root@machine:~# lsusb -v | grep -A5 -B5 -i microsoft | grep -i idvendor
  idVendor           0x045e Microsoft Corp.

Now it is very easy to find out device...

root@machine:~# grep 045e /sys/devices/ -r 2>/dev/null | grep -i idvendor
/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.1/idVendor:045e

So just add /etc/rc.local with line

echo disabled > "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3.1/power/wakeup"

and that's it