Recently i installed Ubuntu 18.04 and started to face a strange issue. while i went to sleep/hibernate mode two of my three USB ports stopped working.
If i restart Ubuntu the USB ports goes back to normal mode.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
This answer from Unix & Linux Stack Exchange (slightly enhanced here) has a solution.
/etc/default/grub and find the line containing
LINUX_DEFAULT. Change the line from:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.autosuspend=-1"
Save the file, run
sudo update-grub, and reboot.
After using this, you will find:
$ cat /sys/module/usbcore/parameters/autosuspend -1
The default value is
2. The kernel parameter changes this value.
Setting the kernel parameter helped me. Now my mouse works again when resuming from suspend.
Suggestion: When USB devices don't work after suspend, you can also reload the driver using the following commands as root:
modprobe -r uhci_hcd modprobe uhci_hcd
modprobe -r ehci_hcd modprobe ehci_hcd
The accepted answer did not work for me and I also don't want to keep up with kernel parameters whenever I reinstall or update grub or boot from another os or whatever. There is a file called
usbreset that installs along with
usbutils. Run that, find the name of the device you want to restart upon wake and put a file into
/lib/systemd/system-sleep I call mine reset-mouse so my file is
If you have that folder, just look at another entry for the format. Mine is:
#!/bin/sh case $1 in post) usbreset "Wireless Device" ;; esac
I got the name "Wireless Device" by running
usbreset from terminal which will also list your devices and tell their name, so whatever device you have a problem with.
sudo chmod +x /lib/systemd/system-sleep/reset-mouse
Then next time my machine went to sleep, and every time after that, it wakes up immediately with no USB issue.