Here's what I tried without success
I’ve disabled USB autosuspend in TLP:
$ sudo tlp usb
Error: USB autosuspend is disabled. Set USB_AUTOSUSPEND=1 in /etc/tlp.conf.
I’ve added a file to /etc/modprobe.d
:
$ cat /etc/modprobe.d/usb-autosuspend
usbcore.autosuspend=-1
I’ve added udev rules, first all input devices then my specific devices:
$ cat /etc/udev/rules.d/92-usb-input-no-powersave.rules
# all input devices (doesn't work?)
ACTION=="add", SUBSYSTEM=="input", TEST=="power/control", ATTR{power/control}="on"
# Trust keyboard
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="145f", ATTR{idProduct}=="024b", TEST=="power/control", ATTR{power/control}="on"
# Trust mouse
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="30fa", ATTR{idProduct}=="0400", TEST=="power/control", ATTR{power/control}="on"
But still, after every restart my input devices still end up having auto suspend enabled
$ cat /sys/bus/usb/devices/3-3/power/control
auto
$ cat /sys/bus/usb/devices/3-4/power/control
auto
I’ve found the solution! From the Linux battery life tuning thread, I’d followed this step:
This caused powertop --auto-tune
to run on startup, completely overriding any other power settings
This can be undone by running
$ sudo systemctl disable powertop
Now all of my earlier attempts can work together to triple make sure that my mouse and keyboard stay on.