I could find similar topics but could not find an answer.

In my system (Xubuntu 20.04) grep . /sys/bus/usb/devices/*/power/wakeup only delivers this


Full list of files in the /sys/bus/usb/devices/3-5/power/


Yet the wireless mouse (+ 2.4GHz USB dongle) wake the system up from suspend. Is there any way to get that specific USB port/device disabled?

The lshw gives me

                product: xHCI Host Controller
                vendor: Linux 5.4.0-70-generic xhci-hcd
                physical id: 0
                bus info: usb@3
                logical name: usb3
                version: 5.04
                capabilities: usb-2.00
                configuration: driver=hub slots=15 speed=480Mbit/s
                   description: Mouse
                   product: Wireless Mouse
                   vendor: Genius
                   physical id: 5
                   bus info: usb@3:5
                   version: 10.01
                   capabilities: usb-1.10
                   configuration: driver=usbhid maxpower=100mA speed=12Mbit/s

And the lsusb -t says

    /:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
    /:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/15p, 480M
        |__ Port 5: Dev 8, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 10: Dev 2, If 2, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 10: Dev 2, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 10: Dev 2, If 3, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 10: Dev 2, If 1, Class=Video, Driver=uvcvideo, 480M
        |__ Port 12: Dev 3, If 0, Class=Vendor Specific Class, Driver=mt7601u, 480M
        |__ Port 13: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
        |__ Port 13: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M
        |__ Port 14: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
    /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
        |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
    /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
        |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M

But since no /sys/bus/usb/devices seems to be relevant I'm not sure what to configure and how.

  • I had a similar problem. I've got a couple of scripts to do it, but it looks like they won't work for you because USB 3-5 already shows as disabled.
    – heynnema
    Commented Apr 2, 2021 at 19:19
  • @heynnema that's exactly what confuses me. because i did research the issue and ppls were suggesting finding the 'enabled' device and simply replace it w/'disabled' in the /sys/bus/usb/devices/*/power/wakeup. But my config shows it's 'disabled' (which i feel actually relates to a different device). Looks like the 'wireless dongle' part is what messes stuff a bit. I just got that wireless mouse and it started waking up my box from the 'sleep/standby' mode even on move... Maybe a better way would be to simply power down the USB port on 'sleep'? Commented Apr 2, 2021 at 22:54
  • You could try to plug/unplug the mouse dongle and confirm which device appear/disappears in lsusb and /sys/bus/usb/devices. Maybe you've already done that.
    – heynnema
    Commented Apr 2, 2021 at 23:10
  • Yes, I did that. It's that same 'USB 3-5' device. Every time the same. Commented Apr 3, 2021 at 2:25
  • Review the other parameters in /sys/bus/usb/devices/3-5/power/ to see if there's anything else that sounds like it has to do with resume/sleep.
    – heynnema
    Commented Apr 3, 2021 at 2:43

3 Answers 3


Writing a value disabled instead of enabled into the file /sys/bus/usb/devices/3-5/power/wakeup is working correctly: when the value is disabled, a corresponding mouse or keyboard doesn't wake up the computer, but if the value is enabled - they wake up it. This helper script do it for a device with particular vendorId and productId:

### Put it here: /usr/bin/usb-resume-control

while getopts v:p:s: flag
    case "${flag}" in
      v) vendor=${OPTARG};;
      p) product=${OPTARG};;
      s) state=${OPTARG};;
if [ -z "$vendor" -o -z "$product" ]; then
        echo -en "Usage: $0 -v vendorId -p productId -s state\nin any order, where vendorId and productId are both from [lsusb] and state can be enable or disable\n"
        exit 1;
if [ -z $state ]; then

for a in `ls $DEVICES`; do
  if [ -f "$DEVICES/$a/idVendor" -a -f "$DEVICES/$a/idProduct" ]; then
    idVendor=`cat "$DEVICES/$a/idVendor"`
    idProduct=`cat "$DEVICES/$a/idProduct"`
    if [ -f "$DEVICES/$a/product" ]; then 
      productName=`cat "$DEVICES/$a/product"`
    if [ $idVendor = $vendor -a $idProduct = $product -a -f "$WAKEUPFILE" ]; then
      oldState=`cat "$WAKEUPFILE"`
      echo "$state" > "$WAKEUPFILE"
      newState=`cat "$WAKEUPFILE"`
      echo Bus-port:$a vendor=$idVendor product=$idProduct name=$productName WakeUp: old=$oldState new=$newState

To automate process create a systemd unit file /etc/systemd/system/control-usb-wakeup-mouse.service with the following content:

Description=Control wakeup of USB device before sleep so they will or not resume the computer

ExecStart=/usr/bin/usb-resume-control -v 045e -p 0745 -s disabled


Update vendorId and productId to your USB device (see output of lsusb). After that run those commands against a unit:

chmod 755 /etc/systemd/system/control-usb-wakeup-mouse.service
systemctl daemon-reload
systemctl enable control-usb-wakeup-mouse.service

Now the device mentioned cannot wake up the computer after sleep.

  • 1
    Thanks for your answer! I was inspired by your solution to write a little tool to make this process easier for daily use and multiple devices: github.com/bvobart/usb-wakeup-control Commented Feb 23 at 23:11
  • Do you know how we could disable all USB devices from waking the computer? I don't like having to do this each time I use a different mouse. I have no need for USB to wake the computer. Commented May 9 at 18:38

Sometimes there are BIOS settings for USB ports to enable/disable power during suspend and/or enable/disable wakeup.

But you may also need to disable wakeup for the relevant USB controllers/hubs. Try this:

cat /proc/acpi/wakeup

I actually don't know how to confirm the device names here is the device you want as the names listed here are different to what you see elsewhere but in my case my USB devices are EHC1, EHC2 and XHC

You can toggle between enabled and disabled by doing for example:

sudo -s
echo XHC > /proc/acpi/wakeup

But I am not sure it's a permanent change. I am not sure on the best way to make it permanent, I just made an executable script to echo the commands I needed and added it to roots crontab like:

@reboot /etc/my_script

  • The problem with the /proc/acpi/wakeup is it will disable the whole controller. So that no other USB device will wake up the box (like my USB keyboard). I was looking for a way to disable precise device. I checked my BIOS setting today. There's no such setting. Commented Apr 2, 2021 at 18:00

I know this is a bit old but I had issues with this too and other solutions did not work. I have found a much simpler solution to this problem and hope it helps.

What uglic says about writing the value disabled instead of enabled into the file /sys/bus/usb/devices/3-5/power/wakeup works correctly is true. Though just to be clear this only works up until you reboot, at that point it is enabled again.

A quick and dirty way to set disabled "permanently" is to simply echo disabled into the **/*/power/wakeup file from the /etc/rc.local file.

echo disabled > /sys/bus/usb/devices/3-5/power/wakeup

Something like that before the last line in the /etc/rc.local file should do the trick.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .