4 ms·
Does any integrated USB hub support per-port power control? I'd like to control a directly-attached USB external hard drive to my Linux box.
by riobard 6y ago
Does any integrated USB hub support per-port power control? I'd like to control a directly-attached USB external hard drive to my Linux box.
- NegativeLatency 6y agoThere are usb cables with inline power/data switches if that helps
- matthewmacleod 6y agoIt’s a difficult thing to find in general. Best list I’ve seen is https://github.com/mvp/uhubctl#compatible-usb-hubs https://github.com/mvp/uhubctl#compatible-usb-hubs
- mikepurvis 6y agoI've delved into this somewhat in an attempt to get some badly-behaved USB cameras under control— the situation is not pretty, especially for USB 3 hubs. I ended up resorting us using a hub that had an internal jumper for disabling bus power, and then just using an external relay to toggle power to the hub itself and all attached devices. This has worked fairly well, though it exposes some other interesting problems which I suspect are deeper issues in the Linux kernel, where "replugging" the same device hundreds of times over the course of days of runtime eventually exhausts some internal resource, causing the port to go completely dead until you unbind/bind the xhci device. Note that if you're not on RPi or some other device with easily usable GPIO to control the relay, you can use any FTDI cable as 4x GPIO, and there are lots of cheap 5V relay breakout boards available.
- jeffbee 6y agoWas curious so I read out HCCPARAMS1 from my Intel xHCI controller and it looks like port power control bit is zero, so no? I think the best you could hope for here is there is some ACPI function you could invoke to power down the whole hub.
- R0b0t1 6y agoSome controllers used to. It's not clear if most still do. There is IOCTL_USB_HUB_CYCLE_PORT in Windows that power cycles a port (https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/usbioctl/ni-usbioctl-ioctl_usb_hub_cycle_port https://docs.microsoft.com/en-us/windows-hardware/drivers/dd...). My research seems to indicate it doesn't always work. The corresponding utility on Linux has problems on modern hardware but the driver may not be complete. For both operating systems, you can likely use the autosuspend features, but this is gated by the driver (at least on Linux) and may not be able to reset a malfunctioning device. For some reason PCIe and USB lack a way to do a hard reset.
- anonymous_fun 6y agoIn the opensource space, https://github.com/mvp/uhubctl/ https://github.com/mvp/uhubctl/. Commercially($++), Acroname or Cambrionix hubs have a lot of features.
- rwmj 6y agoI found a rare D-Link hub that supports it[1]. However it only supports it for a while. After a few port commands the hub crashes and only a hard "reboot" of the hub will fix it. In effect no. [1] https://rwmj.wordpress.com/2015/10/09/usb-per-port-power-switching/ https://rwmj.wordpress.com/2015/10/09/usb-per-port-power-swi...