Misinterpretation of Standard Causing USB Disconnects On Resume In Linux
hypnosec writes "According to a new revelation by Sarah Sharp, misinterpretation of the USB 2.0 standard may have been the culprit behind USB disconnects on resume in Linux all along rather than cheap and buggy devices. According to Sharp the USB core is to blame for the disconnections rather than the devices themselves as the core doesn't wait long enough for the devices to transition from a 'resume state to U0.' The USB 2.0 standard states that system software that handles USB must provide for 10ms resume recovery time (TRSMRCY) during which it shouldn't attempt a connection to the device connected to that particular bus segment."
Clearly the whole thing is broken, and we should transition to a newer, more open and transparent system than even open source.
I will call it OPENER Source. You aren't just able to read the source, you're required to read it!
"Update: Looks like this is an xHCI specific issue, and probably not the cause of the USB device disconnects under EHCI. "
Could have fooled me, I end up spending upwards of 3 months a year fixing bugs in the base os that we ship to run our appliance on. Some of the linux subsystems still read like they were written in someone's basement even after a decade of most of the maintainers being paid a yearly salary to maintain it. God forbid you actually fix some of the crap and post fixes though that are more than ten lines long.. Its a fine way to get blacklisted.
Power Management has worked well on Windows for 15+ years. I'm still waiting for Linux's first year, so problem on Linux are with the kernel and/or the drivers.
Sarah's Google+ post has an update:
Visit the
USB as a whole is already a silly design, having all these silly details and ambiguities. For example, where it has a minimum time (10ms in this case), it should also have a maximum time (for example 50ms). Devices should be able to communicate after that maximum time or they are broken. Actually, there should be a maximum time when powered up ... how is a minimum even useful for anything.
This only needs to specify controller communication, not device function. For example a hard drive might take several seconds to spin up and get in sync. But the controller should be able to do basic communication in 50ms, even if all it can say about the actual hard drive is "spinning up but not ready". USB has a lot of other stuff that is far from the KISS principle.
now we need to go OSS in diesel cars
Unfortunately, the article's referring to the "misinterpretation" passively, not saying directly who the author is asserting misinterpreted the spec, but I think from context it seems to be saying "misinterpreted by Linux", as opposed to "misinterpreted by lots of cheapo USB devices". It's bad that Linux does that, but it's certainly easier to fix in one place in Linux than going out to lots of vendors putting out equipment with very low profit margins and hope they'll all do the right thing.
I was also a bit confused as to when the article was referring to microseconds (s) vs. milliseconds (ms); I found it surprising that it seemed to be saying that most of the devices responded in under a microsecond, while others were over 10ms.
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
Back in the mid-1990s to the mid-2000s when I used Windows, I realized sleep mode was a complete joke, unreliable, and just stopped using it by the time I upgraded to Windows XP or shortly after. In Linux, I am still not a fan of waiting for the damn thing to "wake up" for 5-10 seconds before it will even accept my password, so the only component that ever even enters standby on my machines is the moniter (and this has been the case for over a decade, even dating back to my last years in Windows). Windows, Linux--doesn't matter what the OS is, not putting the system into standby makes the whole experience much smoother, faster and hassle-free.
On the other hand, though--it is a good thing this was fixed for those laptop users out there.
The 10ms is for the software. The flip side of this is that the hardware has a maximum of 10ms to get its shit together so that it can be connected to. And 10ms is forever in hardware.
Far too many vendors are only willing to provide chip documentation under a Non-Disclosure Agreement (NDA), which prevents a knowlege-, as opposed to empirical-based Linux driver. This allows them to kludge around chip deficiencies in a Windows driver without the user being aware of any issues. Even Intel has started making it harder to get the real manuals for their CPUs and bridges (they used to ALL be published on Intel's FTP and HTTP sites). Frequently, in System-on-Chip (SoC) implementations, even the CHIP vendors don't know anything; they just pass along whatever quick and dirty proof of concept the designers of some feature of the chip provided and call it a "working driver", while it is nothing that would pass even a cursory QA process.
The first Linux code I wrote was a "quirk" handler for a parallel ATA PCI chip that came up programmed to the same default I/O addresses as the South Bridge's internal ports, and a BIOS that didn't properly perform PCI enumeration on it, since it already had PCI addresses.
So I can close my laptop now instead of carrying it around like a sort of open pizza box for fear of never having a working mouse until the next reboot? How annoying to start a meeting by rebooting a Linux laptop.
Kriston
Unless the USB is on. It does not wake in time. Craptastic.
That is why my laptop sd-card reader is not working when I close the lid... until reboot. F!*$&%" usb...
Tomorrow is another day...
These weird spam/troll messages are part of what makes Slashdot so unique. ;)
Parent is a troll, but s/he has a point. All this talk about sleep mode being useless sounds more than a little silly from the POV of a Mac user. Macs have had fast, reliable sleep/wake since the second generation G3s around 2000. Windows has kinda caught up. You really want this if you actually use a notebook computer. I don't want to have to go saving and closing everything then shutting down when it's time to get on the plane, then having to open it all again and get back to where I was once I'm on my way to Hong Kong. I just want to be able to flip it shut and put it in the bag, then flip it open when I'm in my seat and be right where I was.
Try pm-suspend-hybrid, this will initiate a normal hibernate: copy ram to disk as usual, but at the end it won't shutdown, but go into suspend. Result: If you come back, its instant on; but if the power ran out or was unplugged, your state is still saved and you return from hibernation.
People still unplug their stuff or let the batteries run out so don't expect that scenario until a memory technology that keeps its state without power (such as mram) becomes the norm.
Artix
Your Linux, your init.
Anyone desiring to use Linux will be required to print out the entire Linux source code (on an Epson dot matrix printer), read every page, and then initial it to confirm their understanding. This will be mailed in to the FSF to track compliance.
If there are any bugs found then everyone who signed that page gets their license revoked.
I am sure with this fool proof plan the Linux userbase will double in no time!