News for hackers. Stuff that matters.
Re:USB drives with no phantom load (2018) by meekrohprocess on Sunday December 06, 2020 @01:47PM (#25325569)
Interestingly, the USB 2.x specification states that a device must not draw more than 500uA (~2.5mW) while it is not being actively addressed by the host.

I frequently wonder how many devices actually adhere to that requirement. Probably not many.

Re:USB drives with no phantom load (2018) by dfox on Sunday December 06, 2020 @02:03PM (#25325712)
That number is not for devices not actively adressed (whathever that means) but for devices that do not have power profile accepted by host. On the other hand it is slightly unclear how that is meant because that is awfully close to the power required for correct device-side Full speed USB termination network. Thus interpretation that I use is that before enumeration the device as a whole should not draw more than 1mA from VBUS.
Re:USB drives with no phantom load (2018) by DoofusOfDeath on Sunday December 06, 2020 @02:07PM (#25325757)
Now I'm curious about the legal angle of this.

If a company claims their product is "USB compatible", but the product doesn't 100% comply with the detailed technical specification, what's the company's liability?

And if the company knew the product didn't strictly meet the USB standard, but marketed the product as "USB compatible" anyway, does that rise to the level of fraud?

Re:USB drives with no phantom load (2018) by londons_explore on Sunday December 06, 2020 @02:18PM (#25325856)
"We claimed our device met USB, which claimed a max power draw while unenumerated of 1mA, yet our device actually used 500mA. Whoops. How long did you have this device unenumerated for? 1 second each time you plugged it in? Well damages can be calculated then...

1 second * 365 (number of times plugged in per year) * 500mA * 5 volts * 5 years (expected lifespan) * $0.14 ($/kWh electricity)...

Total compensation is $0.00014... Would you like a check for that?

Re:USB drives with no phantom load (2018) by yjftsjthsd-h on Sunday December 06, 2020 @03:51PM (#25326505)
No, you sue for false advertising, not the electricity.
Re:USB drives with no phantom load (2018) by jrockway on Sunday December 06, 2020 @05:44PM (#25327377)
I looked up the laws in New York (other states may vary), and you can recover your damages or $500, whichever is greater. You have to prove that the advertiser knowingly misled you (which software bugs probably aren't), and that the false advertising is what influenced your purchase.

I doubt it's likely to succeed. Everyone on the jury will be easily convinced that software is hard to get right, since they have probably used a lot of shitty software and consider it normal.

Re:USB drives with no phantom load (2018) by Dylan16807 on Sunday December 06, 2020 @02:42PM (#25326049)
That's one end of the spectrum. The other end is killing a phone's battery in a couple hours.
Re:USB drives with no phantom load (2018) by R0b0t1 on Sunday December 06, 2020 @04:21PM (#25326770)
I've thought about this a fair bit. Nothing can prevent you from plainly stating what your device does. You can claim interoperability with USB if your device works for the advertised use. You don't need to pay the USB consortium for licensing, but you can't use their branding.

If you don't make a claim about power draw, then I suspect your consumers can't complain unless the power draw is unexpectedly large. And even then, what are the actual damages you need to compensate them for?

Re:USB drives with no phantom load (2018) by oh_sigh on Sunday December 06, 2020 @02:18PM (#25325861)
USB compatible, and USB compliant may be two separate things?
Re:USB drives with no phantom load (2018) by Avery3R on Sunday December 06, 2020 @04:53PM (#25326986)
isn't 500uA the limit for suspend mode? an unconfigured device can pull 100mA and a configured device can pull 500mA
Re:USB drives with no phantom load (2018) by drjasonharrison on Sunday December 06, 2020 @02:21PM (#25325902)
@pabs3 it would helpful if the title used "phantom electrical load"

I initially thought this might have been about phantom partitions or data or functionality not under the control of the owner/user.

Re:USB drives with no phantom load (2018) by nitrogen on Sunday December 06, 2020 @02:47PM (#25326083)
Phantom load is a pretty established term by now, and you were one of today's lucky 10000.
Re:USB drives with no phantom load (2018) by 867-5309 on Sunday December 06, 2020 @03:20PM (#25326312)
perhaps in sound engineering (phantom powered microphones) but I also assumed a security issue / USB bootload
Re:USB drives with no phantom load (2018) by Izkata on Sunday December 06, 2020 @11:11PM (#25329254)
Same here, I was thinking "load" as in "payload".
Re:USB drives with no phantom load (2018) by pabs3 on Sunday December 06, 2020 @06:15PM (#25327604)
Sorry, didn't see this during the edit window. Does anyone know how long that is btw?
Re:USB drives with no phantom load (2018) by sp332 on Sunday December 06, 2020 @11:26PM (#25329308)
Two hours for comments, I think it's the same for post titles.
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
Re:USB drives with no phantom load (2018) by PaulHoule on Sunday December 06, 2020 @02:26PM (#25325935)
The NVIDIA Shield TV can be configured to disable individual USB ports.