In Linux Mint, bumping my mouse or keyboard would wake up my PC from suspend. Here’s how I disabled it.
Find which devices are allowed to wake from suspend
cat /proc/acpi/wakeup
You will see a list like this:
PXSX S4 *disabled
RP08 S4 *disabled
PXSX S4 *disabled
GLAN S4 *disabled pci:0000:00:19.0
EHC1 S4 *enabled pci:0000:00:1d.0
EHC2 S4 *disabled
XHC S4 *enabled pci:0000:00:14.0
TPD4 S4 *disabled
TPD7 S0 *disabled
TPD8 S0 *disabled
HDEF S4 *disabled pci:0000:00:1b.0
Here, the devices EHC1 and XHC are allowed to wake the PC. EHC1 means USB 2.0 bus controller and XHC means USB 3.0 bus controller.
Exactly which device?
If you’re curios exactly which device these are, you can use the lspci to list the PCI devices and grep for the specific device, like this:
lspci | grep :1d.0
displays this on my system:
$ lspci | grep :1d.0
00:1d.0 USB controller: Intel Corporation Wildcat Point-LP USB EHCI Controller (rev 03)
$
Edit your rc.local to disable wakeup for these devices
Edit your rc.local file to add the commands to disable the wakeup. rc.local is executed at boot. Let’s use nano:
sudo nano /etc/rc.local
To disable the USB devices listed above you would add the lines in the example below to the rc.local file before the exit 0 line:
echo "EHC1" > /proc/acpi/wakeup
echo "XHC" > /proc/acpi/wakeup
exit 0
Each time you “echo” the device name into that virtual file, it toggles the enable/disable state. So echoing it disables what was enabled by default.
Reboot the PC to take effect
That’s it!
Reference
- ACPI device abbreviations at Stack Exchange
- Linux Mint discussion