-
Notifications
You must be signed in to change notification settings - Fork 30
Skip detaching USB devices when S0ix is enabled #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
|
Actually, I think this might be invalid because vhci_hcd doesn't want to suspend with an active connection. I'm marking this as draft while I look into it... |
|
There may still be an issue similar to the original one, but this time about device suspend, not disconnect. Specifically, vhci_hcd trying to suspend the USB device, while sys-usb is already suspended. I'm just speculating, but worth checking if that's the case. |
|
In any case, I would be very happy to get rid of this forced disconnection, if possible... |
|
I received the following message on VMs I had a device passed through, and it didn't go to sleep: After reading https://lwn.net/Articles/1031546, I noticed the following: "The USB/IP Virtual Host Controller (VHCI) platform driver is expected to prevent entering system suspend when at least one remote device is attached to the virtual USB root hub." So I don't think we can do this. At least not changes to vhci_hcd to make it suspend capable (with active connections). |
|
I suspect it might be done this way for the standard case of USB/IP really over IP. If that's the only reason, it's probably okay to change it via a patch. But it's a low priority. |
I'll investigate and see how reliable it is with the check removed. |
|
I just tested it with this patch, it doesn't work at all. Suspend fails, and then when it comes back, the USB stack in sys-usb is totally broken and the client domains of the usbip connection get stuck in suspend. Some logs for reference: BTW, until if and when this is fixed, we'll still need to add an exception in https://github.com/QubesOS/qubes-core-agent-linux/blob/main/qubes-rpc/prepare-suspend for the USB controllers under S0ix mode. Otherwise as I reported in the original S0ix issue USB devices won't get reattached on resume. (A temporary workaround is to just not pass the |
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.