News for hackers. Stuff that matters.
Re:USB drives with no phantom load (2018) by riobard on Sunday December 06, 2020 @01:09PM (#25325287)
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.
Re:USB drives with no phantom load (2018) by R0b0t1 on Sunday December 06, 2020 @04:30PM (#25326841)
Some 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/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.

Re:USB drives with no phantom load (2018) by rwmj on Thursday December 10, 2020 @06:10AM (#25372412)
I 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-swi...

Re:USB drives with no phantom load (2018) by anonymous_fun on Monday December 07, 2020 @03:01AM (#25330214)
In the opensource space, https://github.com/mvp/uhubctl/. Commercially($++), Acroname or Cambrionix hubs have a lot of features.
Re:USB drives with no phantom load (2018) by jeffbee on Sunday December 06, 2020 @02:42PM (#25326048)
Was 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.
Re:USB drives with no phantom load (2018) by matthewmacleod on Sunday December 06, 2020 @02:13PM (#25325815)
It’s a difficult thing to find in general. Best list I’ve seen is https://github.com/mvp/uhubctl#compatible-usb-hubs
Re:USB drives with no phantom load (2018) by mikepurvis on Sunday December 06, 2020 @02:26PM (#25325934)
I'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.

Re:USB drives with no phantom load (2018) by NegativeLatency on Sunday December 06, 2020 @02:11PM (#25325796)
There are usb cables with inline power/data switches if that helps