Joshua-Riek / ubuntu-rockchip

Ubuntu for Rockchip RK35XX Devices
https://joshua-riek.github.io/ubuntu-rockchip-download/
GNU General Public License v3.0
2.13k stars 231 forks source link

How to change usbcore /sys/module/usbcore/parameters/autosuspend ? #659

Open artem-zinnatullin opened 6 months ago

artem-zinnatullin commented 6 months ago

Hi,

I'm trying to troubleshoot USB Zigbee dongle disconnects and the suggested solution here https://www.zigbee2mqtt.io/guide/faq/#zigbee2mqtt-crashes-after-some-time is to disable USB autosuspend via Grub setting.

On ubuntu-rockchip v1.33 the USB Autosuspend seems to be set to 2 which allows auto powering off after 2 seconds of inactivity:

cat /sys/module/usbcore/parameters/autosuspend
2

However the distro doesn't seem to have active Grub config wired up in a default Ubuntu way (correct me if I'm wrong please):

find / -name "grub.cfg"
# no results

How does one change the usbcore /sys/module/usbcore/parameters/autosuspend setting so that it persists after reboots?

Linux Kernel docs imply that this setting is distro-specific and depends on how distro loads them up during boot and/or how the usbcore module is compiled-in: https://www.kernel.org/doc/html/v5.10/driver-api/usb/power-management.html#changing-the-default-idle-delay-time so I wanted to clarify with you @Joshua-Riek :)

Related issue: #427

guelermus commented 3 months ago

Hi, For an ARM system, it may help to try the modprobe approach from here: https://unix.stackexchange.com/questions/91027/how-to-disable-usb-autosuspend-on-kernel-3-7-10-or-above Best,