From 16b0919418b4f5e3be69d43dd4d4f4b3388d69ba Mon Sep 17 00:00:00 2001 From: jw Date: Fri, 22 Aug 2025 07:14:46 -0500 Subject: [PATCH] Fix USB autosuspend causing peripheral disconnection issues (#906) * Fix USB autosuspend causing peripheral disconnection issues Add configuration to disable USB autosuspend by setting usbcore.autosuspend=-1 in modprobe.d configuration. This prevents USB devices from being automatically suspended which can cause keyboards, mice, and other peripherals to disconnect unexpectedly. * Add migration to apply autosuspend to existing systems --------- Co-authored-by: David Heinemeier Hansson --- install.sh | 1 + install/config/usb-autosuspend.sh | 6 ++++++ migrations/1755494432.sh | 3 +++ 3 files changed, 10 insertions(+) create mode 100755 install/config/usb-autosuspend.sh create mode 100644 migrations/1755494432.sh diff --git a/install.sh b/install.sh index 55bbd534..b2c0141d 100755 --- a/install.sh +++ b/install.sh @@ -45,6 +45,7 @@ source $OMARCHY_INSTALL/config/detect-keyboard-layout.sh source $OMARCHY_INSTALL/config/fix-fkeys.sh source $OMARCHY_INSTALL/config/network.sh source $OMARCHY_INSTALL/config/power.sh +source $OMARCHY_INSTALL/config/usb-autosuspend.sh source $OMARCHY_INSTALL/config/timezones.sh source $OMARCHY_INSTALL/config/login.sh source $OMARCHY_INSTALL/config/nvidia.sh diff --git a/install/config/usb-autosuspend.sh b/install/config/usb-autosuspend.sh new file mode 100755 index 00000000..a7d820ec --- /dev/null +++ b/install/config/usb-autosuspend.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# Disable USB autosuspend to prevent peripheral disconnection issues +if [[ ! -f /etc/modprobe.d/disable-usb-autosuspend.conf ]]; then + echo "options usbcore autosuspend=-1" | sudo tee /etc/modprobe.d/disable-usb-autosuspend.conf +fi \ No newline at end of file diff --git a/migrations/1755494432.sh b/migrations/1755494432.sh new file mode 100644 index 00000000..d0ae52d0 --- /dev/null +++ b/migrations/1755494432.sh @@ -0,0 +1,3 @@ +echo "Disable USB autosuspend" + +$OMARCHY_PATH/install/config/usb-autosuspend.sh