From a8016eeec1efea9da1ee5bb499b7bc4609e040fb Mon Sep 17 00:00:00 2001 From: Vertex X7-53 Date: Sat, 23 Aug 2025 17:58:12 +0100 Subject: [PATCH] Skip detaching USB devices when S0ix is enabled Skips detaching USB devices when S0ix is enabled using the qubes_exp_pm_use_suspend kernel parameter. Since this parameter prevents drivers from detaching from the host controller, there's no reason to detach devices. This also makes resume from suspend significantly faster as USB devices are available immediately. --- src/usb-detach-all | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/usb-detach-all b/src/usb-detach-all index 01ca648..f006455 100755 --- a/src/usb-detach-all +++ b/src/usb-detach-all @@ -1,7 +1,11 @@ #!/bin/sh -# Detach all devices before suspend +# Skip when S0ix is enabled, since we don't detach the host controller drivers +if grep -q qubes_exp_pm_use_suspend=1 /proc/cmdline; then + exit 0 +fi +# Detach all devices before suspend for dev in /sys/bus/usb/devices/*/usbip_sockfd; do if [ -w "$dev" ]; then echo -1 > "$dev"