×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Misinterpretation of Standard Causing USB Disconnects On Resume In Linux

samzenpus posted about 8 months ago | from the who's-to-blame dept.

Linux 280

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."

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

280 comments

Happy Thursday from The Golden Girls! (-1, Offtopic)

Anonymous Coward | about 8 months ago | (#44650383)

Thank you for being a friend
Traveled down the road and back again
Your heart is true, you're a pal and a cosmonaut.

And if you threw a party
Invited everyone you knew
You would see the biggest gift would be from me
And the card attached would say, thank you for being a friend.

Re:Happy Thursday from The Golden Girls! (-1, Offtopic)

DG (989) | about 8 months ago | (#44650689)

Cosmonaut?

Try "confidant"

Re:Happy Thursday from The Golden Girls! (0)

Anonymous Coward | about 8 months ago | (#44650709)

idiot

Re:Happy Thursday from The Golden Girls! (2)

jones_supa (887896) | about 8 months ago | (#44651155)

These weird spam/troll messages are part of what makes Slashdot so unique. ;)

A bug in Linux? (5, Funny)

Anonymous Coward | about 8 months ago | (#44650385)

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 (5, Informative)

Anonymous Coward | about 8 months ago | (#44650399)

"Update: Looks like this is an xHCI specific issue, and probably not the cause of the USB device disconnects under EHCI. "

linux has bugs? (5, Interesting)

Anonymous Coward | about 8 months ago | (#44650441)

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.

Re:linux has bugs? (1)

Anonymous Coward | about 8 months ago | (#44650501)

They don't want the OS to be correct, they want all the f'ed up applications to work no matter how f'ed up they are.

Re:linux has bugs? (5, Insightful)

TheGavster (774657) | about 8 months ago | (#44650571)

It's true. Linus has been quite vocal [lkml.org] about whose fault it is when a kernel change breaks an application...

Re:linux has bugs? (3, Insightful)

LordLimecat (1103839) | about 8 months ago | (#44650957)

Im not a software dev, but I have never agreed with this:

If a change results in user programs breaking, it's a bug in the kernel. We never EVER blame the user programs.

What happens when some program has been using a privilege escalation bug to get around sudo, and it breaks when the kernel is patched to fix the vulnerability? Is that still "a kernel bug", should they not patch it? It seems to me that, yes, you try not to break applications, but this is why you have an official, supported API, and if bad developers want to rely on buggy kernel behavior for their programs, you have to choose between either screwing them, or screwing everyone else.

If anyone can enlighten me as to why thats wrong, Id appreciate it.

Re:linux has bugs? (5, Insightful)

Anonymous Coward | about 8 months ago | (#44651013)

For all practical purposes there's no way, I repeat, no way to "heat the whole apartment block" to eradicate bed bugs.

So you don't know what you are talking about.

If anyone can enlighten me as to why thats wrong, Id appreciate it.

1. syscall returns -EFOO when to report condition A
2. hmm, someone notices that -EFOO is too generic. That syscall should return the more specific -ECOND_A_ERROR instead. They change it.
3. ALL SOFTWARE suddenly works *different* and perhaps does not work at all on the modified kernel that uses that syscall vs.older kernel.

Kapish??

Do not change API internals. Fixing undocumented features (ie. bugs, like overflows) is one thing. Modifying documented and established API on a whim is a bad bad bad thing.

If you want to modify it like that, you do the following,

1. syscall returns -EFOO when to report condition A
2. hmm, someone notices that -EFOO is too generic. That syscall should return the more specific -ECOND_A_ERROR instead. SO MAKE A NEW SYSCALL THAT RETURNS CORRECT! Leave old one as deprecated for removal in some years.
3. ALL SOFTWARE continues to work.

If #2 is too much effort for reward, then do nothing. But above all, do not break userland with kernel changes. Ever.

Re:linux has bugs? (1)

KGIII (973947) | about 8 months ago | (#44651643)

Define "some years?" What if the application developer doesn't change the behavior after those some years have passed? Isn't ensuring backwards compatibility one of the reasons that Windows has had so many security issues? If so then do you really want to have to be constantly on the lookout for those same issues in the Linux kernel? Finally, why does Linus insist on acting like a child?

I don't suppose you'll truly know the answer to the last question but I'd appreciate any speculation. Keep in mind that, well, I'm actually quite a fan of Linux (I prefer Mandriva though I'm not opposed to Ubuntu - both seem to be somewhere near my skill level though they've "dumbed down" Ubuntu a bit it seems or I've just acclimated to it) and though I have nothing invested (other than personal interest) it seems as if he's a petulant child at times. Okay, quite frequently... That's sad because having someone approachable would probably be a good thing for Linux. As for approachability, you have RMS and Linus... Yeah...

It's a shame really because I think that we truly could have had a year of Linux on the Destkop® by now if it weren't for the behavior of some of the most vocal and closely associated people. And no, it wouldn't have ever really have been that year but it likely would have been a lot closer and a lot more popular. The goal is to encourage people to be free or at least examine their options, yes?

Re:linux has bugs? (1)

Vhann (1862350) | about 8 months ago | (#44651719)

What if the application developer doesn't change the behavior after those some years have passed?

Then the application gives a "clean break" at compile-time or segfaults if not recompiled. This happens all the time (“if not maintained, software rots”), use maintained applications or don't update your kernel.

Isn't ensuring backwards compatibility one of the reasons that Windows has had so many security issues? If so then do you really want to have to be constantly on the lookout for those same issues in the Linux kernel?

Security bugs are most likely handled differently, I do not know.

Finally, why does Linus insist on acting like a child?

That's your opinion. When you actually understand what he talks about, you may understand why he “acts like a child” (I'm not exactly sure what that means anyway). I'm guessing Linus is pretty good at what he does considering how nobody decided to fork yet.

Re:linux has bugs? (5, Informative)

hedwards (940851) | about 8 months ago | (#44651217)

Basically, the kernel has an Application Binary Interface which is a bit like a contract. If the application gives the kernel something formatted in a specific way, the kernal promises to give it back something in a specific way and the other way around. Any software that is written to respect the contract should never be broken by a change to the kernel as the application has no knowledge of how the kernel performs its obligation.

Changes to the ABI are not supposed to be common events. They're supposed to be changed only when lesser changes can't work. FreeBSD handles it using compatibility libraries which maintain the ABI for various kernel revisions so that applications can continue to use older ones if need be. AFAIK, Linux doesn't do that, and as a result, the kernel maintainer and the developers writing the code have to be even more careful about changes made not messing up the ABI.

Also, because Linux is just a kernel without a userland, a change to the Linux kernel that was permitted to break the ABI could hose all of the distros all at once requiring the rewrite of hundreds of little bits of software that are cobbled together to make the distros function as complete OSes.

There's more to it, but that's basically why Linus takes the stance that the kernel is to blame and not the developer. But, he undoubtedly doesn't consider it to be the kernel's fault if a developer does things that don't comply with the normal ABI specifications.

Re:linux has bugs? (1)

KGIII (973947) | about 8 months ago | (#44651667)

Basically, the kernel has an Application Binary Interface which is a bit like a contract. If the application gives the kernel something formatted in a specific way, the kernal promises to give it back something in a specific way and the other way around. Any software that is written to respect the contract should never be broken by a change to the kernel as the application has no knowledge of how the kernel performs its obligation.

That was a very good explanation and describes it in a manner that I've never seen before but it does describe it very well. So, in short, thank you for that. Even if I had mod points I'd rather just thank you for having taken the time to come up with that description (I spent 'em already, they'll probably give me more tomorrow) because, frankly, that's the best description I've seen of an ABI and how it probably *should* be done. It brings to mind some security questions (example: What do you do, from the kernel developer standpoint, if it turns out that the ABI has a security flaw in it - say it's an older ABI that is seldom used or the likes?) but I think those questions can wait for a better time and place.

Re:linux has bugs? (2)

You're All Wrong (573825) | about 8 months ago | (#44651311)

And Alan Cox resigned as maintainer of the TTY subsystem because of this attitude. (Userspace was clearly broken, and a kernel change made this clear, however, in Linus' eyes, that was "breaking userspace") Just because Linus holds that opinion doesn't mean that it's universally shared to the same extent (everyone agrees to some extent, but not to absolutes).

Re:linux has bugs? (-1)

Anonymous Coward | about 8 months ago | (#44650819)

Nice try, paid Microsoft troll.

Re:linux has bugs? (1, Informative)

Osgeld (1900440) | about 8 months ago | (#44651199)

shh, its talk like that gets you downmodded to hell a week after the fact by the fanboi's who think icewasel + linux + libre office is all the universe needs

Re:linux has bugs? (3, Insightful)

You're All Wrong (573825) | about 8 months ago | (#44651303)

Strange. I'll admit that Linux has some drivers that are full of bugs, but the ones that are most full of bugs seem to be ones thrown over the wall by large hardware vendors. You know the ones - the drivers with 20000-line C files, that create 2000 checkpatch warnings. Those drivers were written by salaried employees, not sitting in their basement.

not surprising (2, Interesting)

angryargus (559948) | about 8 months ago | (#44650521)

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.

Re:not surprising (4, Informative)

Anonymous Coward | about 8 months ago | (#44650587)

You just said power management worked well on windows 98 and 95.

I am calling you a liar.

Re: not surprising (0, Flamebait)

Anonymous Coward | about 8 months ago | (#44651105)

he just means better than linux. they're trying to add crap to the kernel all the time. you want them to fix stuff too? soon linux will be just as bloated as nt and still doesn't work right
w8 actually works, but you cli freaks are freaky.
learn to program.

Re: not surprising (2)

hedwards (940851) | about 8 months ago | (#44651235)

Which is easy for MS to achieve as they're willing to implement a non-standard ACPI implementation rather than using the Intel implementation that everybody else uses. And write work arounds for buggy implementations rather than kick it back to the manufacturer to do correctly.

Linux doesn't have that luxury, which means that DSDT changes and such have to be done by the end user rather than the developer that should have implemented the standard correctly in the first place.

Re:not surprising (2)

davester666 (731373) | about 8 months ago | (#44651351)

You flipped the switch or hit the power button, it turned on, flip/hit it again, it went off. What didn't work right?

Re:not surprising (4, Informative)

TheGavster (774657) | about 8 months ago | (#44650599)

15+ years is a stretch. Even in the 2006-07 era at the end of XP's development, there were brand new machines that couldn't return from sleep correctly. It was particularly vexing since a lot of them were laptops factory configured to sleep when left unattended. I will say that I haven't had any complaints with S3 sleep since the advent of Windows 7, however.

Re:not surprising (2)

DG (989) | about 8 months ago | (#44650703)

I've got an XP laptop that instantly BSODs the second you close the lid.

So yeah, myth busted.

DG

Re:not surprising (3, Insightful)

Barsteward (969998) | about 8 months ago | (#44651753)

i've got a laptop that blue screens when you pull out the power cord.

If i remember correctly a lot of the power management problems are due to the manufacturers not implementing the standards correctly, they implemented them to the broken Windows implementation in order to keep WIndows working.

Re:not surprising (1)

Stewie241 (1035724) | about 8 months ago | (#44650761)

Have a couple of Acer laptops running Windows 7 with displays that frequently (always?) don't come up out of sleep. The solution is to close the laptop and open it again, but this is obviously quite a pain. Linux actually performs better in this regard on the one. THe other one is my wife's so it isn't running Linux.

Re:not surprising (4, Funny)

philip.paradis (2580427) | about 8 months ago | (#44650815)

THe other one is my wife's so it isn't running Linux.

My wife's laptop is running Debian 7. What's up with your wife? :)

Re:not surprising (1)

Anonymous Coward | about 8 months ago | (#44650883)

> My wife's laptop is running Debian 7. What's up with your wife? :)

Yo, Ian!

Re:not surprising (1)

AlreadyStarted (523251) | about 8 months ago | (#44650903)

THe other one is my wife's so it isn't running Linux.

My wife's laptop is running Debian 7. What's up with your wife? :)

My guess is his is not imaginary.

Re:not surprising (1, Offtopic)

philip.paradis (2580427) | about 8 months ago | (#44651347)

Oh heavens, it must be happening again. I'm obviously experiencing a relapse of those terrible hallucinations that have plagued me for years. Oddly enough, they seem to be at their worst when I'm at home. I've had visions of a beautiful woman in my house, with two beautiful little girls running around as well. I know, I should seek medical attention immediately, as this could be a sign of a serious condition. Speaking of conditions, my sense of reality is so distorted that I've come to believe my fictitious wife is pregnant with our third child! I've obviously taken a head first dive off the deep end.

Oh, wait, she's real after all [palegray.net]. There she is, sitting on my couch, with her laptop running Debian 7, eating the steak I just cooked, wearing a shirt from my employer, grimacing at the thought of me putting this on Facebook. I guess I only stretched the truth a tad by putting it on /. instead.

Re:not surprising (0)

Anonymous Coward | about 8 months ago | (#44651397)

You motherfucker

Re:not surprising (1)

KGIII (973947) | about 8 months ago | (#44651689)

Wait... I thought you said she was beautiful? ;)

I'm just screwing with you - she's a wonderful looking woman and has good taste in operating systems as well assuming she uses it because she likes to and not because it pleases you. Then again, doing it for the latter reason isn't horrific or anything but I'm an idealist I guess. (Which is why I no longer have a wife.)

Re:not surprising (2, Informative)

angryargus (559948) | about 8 months ago | (#44651115)

There's a big difference between Windows where problems are a corner case, vs. Linux where success is a corner case. But the point still remains that I've used sleep and hibernate on most of my Windows machines without really fearing problems or data loss (I'll still save any progress before initiating it, though thanks to Office 97 I'm in the habit of saving regularly regardless), but I can't think of even bothering to try such a thing on Linux (nor can even of the people I know who love Linux enough to actually enjoy updating to a new distro every few months/years). I probably won't even think of trying to use sleep or hibernate on a Linux box until I see that the Linux kernel has developed drivers models that have some hint of being designed with power management in mind. Heck even the PCI driver model in Linux doesn't fit the spec well. Most Linux drivers I've had to deal with need to mess with the device's PCI configuration space themselves, whereas on Windows that's pretty rare because it's usually handled by the core kernel (which was the intent of the PCI spec based on how it's written).

Re:not surprising (3, Informative)

Qzukk (229616) | about 8 months ago | (#44650623)

Spoken like someone who's never had to reboot a computer from coma mode.

Re:not surprising, since there are few docs (5, Informative)

dltaylor (7510) | about 8 months ago | (#44650657)

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.

Re: not surprising (2)

Jeremiah Cornelius (137) | about 8 months ago | (#44650693)

Power management ?

It's worked well for years on Linux. Only problems I ever had were involving nVidia workaround drivers and sleep.

Re:not surprising (2)

jamesh (87723) | about 8 months ago | (#44650747)

My Windows 7 laptop will regularly not come out of sleep, requiring a battery removal to resolve. This occurs more often when I'm packing up and unplug something while it's going to sleep. Typically this happens after about 3 weeks since last reboot, which really sucks because it only has to get to a month and it gets rebooted to install updates anyway.

The other annoying thing it does is when it wakes up it still thinks it has the external monitor attached (the VGA/DVI monitor only - the USB attached ones are fine). To resolve this when i've changed location and have another second screen I have to unplug it, wait a few seconds, then plug it back in again. Worse when I'm somewhere where I don't have a second screen at all and I have to muck around to get Windows to understand I only have the laptop screen

Now it's probably true that the above issues are caused by third party drivers, and not Windows itself, but it still sucks.

Re:not surprising (1)

Vhann (1862350) | about 8 months ago | (#44651781)

Have a look at what your typical DSDT looks like and you may get an idea why shit doesn't work well (well, not always).

Basically, the DSDT is a table which the BIOS passes to the system to tell it what the ACPI is on the current machine. One of the "nice features" of the DSDT is its use of conditionals which look something like this (in BASH-like pseudo-code):

if [ _OS = "Windows XP Pro" ]; then /*Define the DSDT for Win XP here*/
else if [ _OS = "Windows 98" ]; then /*define the DSDT for Win98 here*/
else /*Well, we don't support you, so you are on your own*/
fi

One of the ways Linux-acpi tried to get this to work was to define _OS as "Windows XP Pro", but IIRC that didn't work because some vendors provide really broken DSDT who enable certain things under Win98 but disable it under Win XP (and conversely). In short, it is a mess.
So, at some point the way to get things to work was to extract the DSDT, modify it to pass Intel's compiler checks and once everything was sane, override the system one with this correct one via a bootloader option. This approach was eventually abandoned and the current approach is to try to get things to work "out-of-the-box". How that can be pulled off in these conditions is beyond me.

I do not know how to explain why the fact that the company that dev'ed the hardware developing the Windows drivers means it works there but nowhere else.

Maybe not all the disconnects? (5, Informative)

AdamHaun (43173) | about 8 months ago | (#44650567)

Sarah's Google+ post has an update:

Update: Looks like this is an xHCI specific issue, and probably not the cause of the USB device disconnects under EHCI. To everyone who commented with other USB issues (none of which really sounded related), please email the linux-usb mailing list with a description of your issue.

USB sucks (4, Informative)

Skapare (16644) | about 8 months ago | (#44650583)

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.

Welcome to EE (4, Insightful)

Ignacio (1465) | about 8 months ago | (#44650637)

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.

Re:Welcome to EE (2)

jamesh (87723) | about 8 months ago | (#44650707)

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.

Dear Linux kernel, i'll be ready when my disk is done spinning up. kthanksbye

Re:Welcome to EE (5, Funny)

Ignacio (1465) | about 8 months ago | (#44650723)

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.

Dear Linux kernel, i'll be ready when my disk is done spinning up. kthanksbye

Dear USB hard drive, that's fine, but don't go and disconnect from the USB bus in the meantime. Forever waiting, Linux kernel.

Re:Welcome to EE (1)

FrankSchwab (675585) | about 8 months ago | (#44650851)

And 10ms is forever in hardware.

Not if the hardware is composed of a microprocessor, and the hardware holds the CPU in reset for 2 ms waiting for the crystal to stabilize before letting it run.

The 10 ms is for the DEVICE to get it's shit together. Coming out of suspend, the host starts sending SOF's, and must not send anything else to the device for 10 ms. The DEVICE is required to be ready for communications from the host after this 10 ms period.

Re:USB sucks (2)

skids (119237) | about 8 months ago | (#44650671)

You're pulling your punches. USB was a completely half-ass standard to start with, and then was continually modified with half-ass frankenstein additions to provide features that were already in competing bus technologies, once its designers finally had to admit that those features were actually useful.

Anyway it is not much of a surprise that things can slip in the USB area. There are only a few developers who are both talented enough to work do it right and also have the patience for wasting their talent making the dung sculptures that USB stacks always turn out to be.

(Personally I think the better path would have been to just use CAT5 UTP with ethernet signalling but a frame protocol that would just shut down a port if it detected you plugging normal ethernet into the bus. Then all the ports could have been bios-configurable for either peripheral or network use.)

Re:USB sucks (2)

TheGratefulNet (143330) | about 8 months ago | (#44650841)

well, you CAN plug a usb male connector into an rj45 jack.

it won't work, but it will fit just fine.

(stupid oversight. the last 15 or so years, cable and connector designers have been pretty idiotic. don't get me started on that rant..)

Re:USB sucks (1)

You're All Wrong (573825) | about 8 months ago | (#44651329)

You're not one of those heretics that thinks that ethernet was a bus technology that was both serial and universal, at the time that the so-called "USB" was invented, are you?

Re:USB sucks (1)

KGIII (973947) | about 8 months ago | (#44651721)

Shh! You won't get burned at the stake around here - they'll burn you at the stack in these parts.

Re:USB sucks (2)

tlhIngan (30335) | about 8 months ago | (#44651439)

You're pulling your punches. USB was a completely half-ass standard to start with, and then was continually modified with half-ass frankenstein additions to provide features that were already in competing bus technologies, once its designers finally had to admit that those features were actually useful.

Anyway it is not much of a surprise that things can slip in the USB area. There are only a few developers who are both talented enough to work do it right and also have the patience for wasting their talent making the dung sculptures that USB stacks always turn out to be.

Things in USB have generally been quite buggy and will always be that way - it's quite a complex spec and controllers and software never behave the way they should.

Take something like initial enumeration - the initial descriptor you read is 18 bytes long. Neither Linux nor Windows actually does an 18-byte read to get a full descriptor. I suppose it could be a USB test to ensure your controller software can handle an undersized read without screwing up.

Then there was the time I screwed up my USB descriptor (screwed up the type). End result was Linux kept panicking on me - the moment I plug it in, boom panic. (This was years ago. I would assume it's fixed). Windows didn't do anything.

I think part of the problem is basically there hasn't been any USB fuzzing tools, so most USB stacks are buggy and have lots of exploitable flaws. Hell, it was how the PS3 was exploited once.

Re:USB sucks (1)

sl149q (1537343) | about 8 months ago | (#44650691)

In the best of all worlds, devices should treat it as a maximum and hosts should treat it as a minimum.

Re:USB sucks (2)

FrankSchwab (675585) | about 8 months ago | (#44650873)

In the SPEC, devices are required to treat it as a maximum and the host is required to treat it as a minimum. Any device which isn't ready for communications after 10 ms are broken, and any host that attempts communications before 10 ms is broken. This isn't an area of the spec that's in any way vague.

Re:USB sucks (2)

You're All Wrong (573825) | about 8 months ago | (#44651341)

Agreed.

Do we think that Sarah will receive some trademarked swearing because of this?
http://news.techeye.net/chips/linus-torvalds-and-intel-woman-in-sweary-spat
http://linux.slashdot.org/story/13/07/15/2316219/kernel-dev-tells-linus-torvalds-to-stop-using-abusive-language

I'm beginning to wonder if Sharp is a MS or Apple plant, sent into linux kernel work to sow seeds of antagonism and self-destruction.

Misinterpretation *By Linux* (2)

billstewart (78916) | about 8 months ago | (#44650585)

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.

Re:Misinterpretation *By Linux* (0)

smash (1351) | about 8 months ago | (#44650645)

Given that the spec says this is a MINIMUM value, then I'd say the misinterpretation is in Linux - by hard-coding in 10ms and attempting to use devices after that. As per TFA, an interrupt is generated by an xHCI controller when the device is ready to use again. So, blindly attempting to use the device again after 10ms is breakage in LINUX.

I'd also say that the USB spec is written in a pretty broken way to cause said confusion, but that's a whole new issue.

Re:Misinterpretation *By Linux* (4, Insightful)

FrankSchwab (675585) | about 8 months ago | (#44650993)

There is no ambiguity in the USB spec, and Sarah has an incorrect interpretation. The spec requires that the host provide at least 10 ms of recovery time coming out of suspend; a device is required to be able to communicate after this minimum time. Any device which isn't ready for communications after 10 ms of resume recovery time is broken. A host is permitted to provide more than this, but isn't required to.

So, yes, it's perfectly valid for the host to blindly attempt to communicate with the device after 10 ms - presuming that the host KNOWS precisely when the recovery period began. If the host requested that the bus resume, set a timer for 10 ms, and then tried talking, the HOST is at fault because it didn't check with the hardware as to when the resume period began. I think the 17 ms that they reference in the article is related to this - there is a delay between the request to resume the bus and the actual time that the hardware does resume the bus, so they were trying to talk with devices before the 10 ms period was up.

The device is perfectly within the spec if it ignores communications prior to 10 ms, or if it responds to them - it has complete flexibility. After 10 ms, however, it MUST be ready to communicate.

Re:Misinterpretation *By Linux* (2)

smash (1351) | about 8 months ago | (#44651343)

Meanwhile, USB works just fine on my Mac, Windows and FreeBSD hardware. Sounds like someone implemented the spec and someone is blaming everyone else.

Re:Misinterpretation *By Linux* (1)

You're All Wrong (573825) | about 8 months ago | (#44651371)

You are just plain wrong.

The standard mandate (a "must") that the host wait a minimum of 10ms. The linux kernel waits a minimum of 10ms. It is doing everything that is required of it by the standard. Therefore it is standards conforming. If shitty hardware isn't going to be ready for 17ms, then it is solely at fault. There is no ambiguity in the standard on this point.

Re:Misinterpretation *By Linux* (1)

Darinbob (1142669) | about 8 months ago | (#44650727)

I have used Linux in the past as a rough guideline to determine what something ambiguous means. The assumption is that the devices work in Linux and have been tested somewhat, therefore how Linux does things is a better first approximation of what I should do than just guessing. I also hedged this by looking at xBSD code which is easier to understand.

A lot of times when it's safest to just try and figure out what Windows does because there are countless devices that only support the commands that Windows sends. So even if the standard says command X shall be supported, if Windows never sends that command to a device chances are there are some devices that won't have it implemented properly. So a USB sniffer helps here. When it comes to commodity parts intended for generic PCs, standards are treated as suggestions.

Re:Misinterpretation *By Linux* (1)

You're All Wrong (573825) | about 8 months ago | (#44651391)

You have to remember that MS Windows violates the USB standard even though it was one of the authors of the standard, and because of this influence they have been able to pollute the conformance tests in order to work around their errors. Therefore the whole issue of compatibility is a very muddy one. Are you conformant to the standard, or to the test?

Developer has posted an update (0)

aNonnyMouseCowered (2693969) | about 8 months ago | (#44650593)

I don't know how relevant this new info is to the problem, but there's an update over at the Sarah Sharp's G+ page:

"Update: Looks like this is an xHCI specific issue, and probably not the cause of the USB device disconnects under EHCI. To everyone who commented with other USB issues (none of which really sounded related), please email the linux-usb mailing list with a description of your issue."

Captcha: corrects (I hope I'm not wrong.)

Resume? What's that? (4, Insightful)

UltraZelda64 (2309504) | about 8 months ago | (#44650609)

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.

Re:Resume? What's that? (1)

viperidaenz (2515578) | about 8 months ago | (#44650877)

My 8 year old laptop running Windows XP usually wakes up in under 5 seconds from sleep.
When it was brand new it would last around 5 hours with the lid shut and turned on (it consumed around 10 - 12W idle with the screen off, with a 65Wh batter). On standby it would last weeks

Standby support for a laptop is mandatory..

Re:Resume? What's that? (1)

sunderland56 (621843) | about 8 months ago | (#44651117)

My several-year-old laptop running Xubuntu *boots* in about 5 seconds.

Even now it lasts weeks when powered down. It consumes about 0 watts when powered down.

Standby support is only mandatory for OSes that take a rediculously long time to boot.

Re:Resume? What's that? (2)

hedwards (940851) | about 8 months ago | (#44651273)

Not true.

Standby is there for when you want to leave your desktop applications open and have the benefits of using less energy while you eat dinner or take a walk. Hibernation is great if you need that 0 watts of draw, but don't want to have to have all your programs closed down and to have to start from scratch.

Re:Resume? What's that? (1)

UltraZelda64 (2309504) | about 8 months ago | (#44651177)

My problem is that I'm impatient: 5 seconds is too too for me to wait for a machine plugged into a wall outlet to become responsive, and all of my computers to date have been desktop machines. But I agree with you that standby is very important on a laptop.

I have never owned a laptop myself, but I likely will end up buying one at some point and have been considering what I will be doing as far as power management goes. I'm considering running the system 24/7 without the battery (to conserve it) and plugged into my desktop keyboard and monitor when it will be at home for a week or more at a time during which point I may turn off all power management features, and shut it down and plug the battery in when I leave, using various power saving modes when necessary... but I will still most likely just shut down whenever possible to get the biggest savings.

Overkill? More work than is typically done? Well, what can I say... I'm really, really not a fan of power management features, but I will use them when absolutely necessary, and even then only under special conditions. :p

If I'm going to have to wait anyway, the way I see it I might as well just go all the way and shut the machine down completely, saving the most battery when not in use for an extended period of time.

Re:Resume? What's that? (0)

Anonymous Coward | about 8 months ago | (#44650919)

Are you talking about the hibernate or sleep function? I've always felt the same about hibernate, and sleep just started working for me in Linux this year -- on SimplyMepis 12 (KDE 4.8.4), my nine-year-old Thinkpad comes out of sleep almost instantly, and I have it set to not ask for my password after initially logging in.

Re:Resume? What's that? (0)

Anonymous Coward | about 8 months ago | (#44651025)

Hmmm. Your experiences are your own. I put this thing to sleep all the time. Some kernels work a bit better than others. This one hasn't given me any issues (3.11.0-rc6). I think 3.11.0-rc5 might have had problems, but the 5 or 6 kernels previous to that were no problem.

Re:Resume? What's that? (0)

Anonymous Coward | about 8 months ago | (#44651457)

My two year old netbook (amd c-50; so slower than anything other than an Intel Atom) running Debian Wheezy wakes up from sleep in under a second (suspending is just as fast). For suspend to ram, amount of ram seems not to have any impact on time to suspend/resume-- netbook shipped with 2G, I've upgraded it to 8G without any change in suspend resume time.

Maybe you are thinking of suspend to disk ("hibernate"). That takes quite a bit longer, esp. if you have a lot of memory in use-- disk is slow.

Re:Resume? What's that? (1)

You're All Wrong (573825) | about 8 months ago | (#44651467)

Just tested: pm-suspend took a verbal count of "and one, and " before the final LED was off.
Pressing the power button to wake it up took a verbal count of "and one and t.." before I had the root prompt back, but it had remembered the carriage return that I had pressed a fraction of a second earlier. So let's call that about 1.5s in both directions.

At its highest frequency, it's this (but is currently ticking over at 800MHz, no idea how stressed it was during those few seconds):
model name : Intel(R) Atom(TM) CPU N270 @ 1.60GHz

I suggest you profile your system whilst suspend and resume are taking place. Your times are unnaturally high. dmesg will contain a fair bit of info, such as:
[18792.336078] PM: suspend of devices complete after 627.338 msecs
[18792.336340] PM: late suspend of devices complete after 0.254 msecs
and
[19427.808460] PM: resume of devices complete after 1499.933 msecs
[19427.942491] Restarting tasks ... done.
etc.

Impossible, she's too hot (0, Troll)

Gothmolly (148874) | about 8 months ago | (#44650613)

She's too hot to be a programmer. This is clearly a front or shill by some middle-aged neckbeard.

Re:Impossible, she's too hot (-1)

Anonymous Coward | about 8 months ago | (#44650719)

If she had bigger ears she'd look like Quark's mom from Star Trek: Deep Space Nine. Though, she's probably a Heidi Klum* according to your standards.

* The blonde Aryan supermodel who chose to date an ugly black man because he has a big dick

-- Ethanol-fueled

Re:Impossible, she's too hot (-1)

Anonymous Coward | about 8 months ago | (#44650733)

If by hot you mean fucked up teeth, then alright. You can have her.

So I can close my laptop now? (3, Informative)

kriston (7886) | about 8 months ago | (#44650679)

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.

Re:So I can close my laptop now? (1)

Yoda222 (943886) | about 8 months ago | (#44650783)

Why do you need a mouse ?

what is this mouse of which you write? (0)

Anonymous Coward | about 8 months ago | (#44650871)

I have toggle switches and neon bulbs for an interface.

Re:what is this mouse of which you write? (0)

Anonymous Coward | about 8 months ago | (#44651225)

on laptop?

Re:So I can close my laptop now? (4, Insightful)

tlhIngan (30335) | about 8 months ago | (#44651403)

Why do you need a mouse ?

Because most laptops generally have terrible pointing devices. If they have touchpads, they're usually far too tiny to be useful (Apple ones excluded - why can't others put big ass touchpads on their laptops?)

The rubber trackpoint ones are nice for PCs, though the rubber tips wear down way too quickly and you end up with a slippery lump in short order.

And practically all are pathetic at scrolling. Unless it's an Apple trackpad where the double finger scroll works (once you fix the ()#@% scroll direction).

Life's just generally easier with an external pointing device.

Re:So I can close my laptop now? (1)

Barsteward (969998) | about 8 months ago | (#44651795)

i prefer a mouse as well, what i'd really prefer would be a laptop with a touch screen. i hate touchpads etc.

Re:So I can close my laptop now? (1)

paskie (539112) | about 8 months ago | (#44651007)

Not sure why would you fear for never having a working mouse until the next reboot, but besides that, may I kindly suggest configuring your laptop not to go to sleep when the lid closes? It really doesn't have to do that if you don't wish it to.

Re:So I can close my laptop now? (2)

kriston (7886) | about 8 months ago | (#44651077)

That's the obvious solution, but, really, my computer should not lose the ability to be controlled by a USB device just because it went to sleep when the lid was closed. My Windows laptop has done this successfully for, like, fifteen years now?

Re:So I can close my laptop now? (1)

Osgeld (1900440) | about 8 months ago | (#44651221)

exactly

the problem according to the linux crowd is you want your computer to go into a low power state during periods of transport, nevermind that the lowest common denominator does it just fucking fine

its your hardware's problem and your choice to use it like a normal person

Kickstarter idea (0)

Anonymous Coward | about 8 months ago | (#44651759)

Maybe all you need is the right protective sleeve that fits the laptop in this positon. Like two sleeves sewed together or something. Or something like a plastic box with a handle ? Could be included: a Teensy based USB device that sends mouse events every 30 seconds to prevent computer from going to sleep. See ? Problem "solved".

linux is atrocious (-1)

Anonymous Coward | about 8 months ago | (#44650687)

stop being cheap and get a mac

Learn to punctuate (0)

Anonymous Coward | about 8 months ago | (#44650843)

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 “'esume 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."'

Wow, ever heard of something called "comma"? Let me fix that for you.

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 “'esume 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."'

See? Much easier to understand now. Other than that, I'm guessing that "esume" is a typo, and the quotation marks are all messed up too.

Re:Learn to punctuate (1)

ebno-10db (1459097) | about 8 months ago | (#44651015)

Wow, ever heard of something called "comma"?

Wow, ever heard of something called a "comma"?

I also don't find that commas make that paragraph any more readable.

It explains a lot! (3, Insightful)

gagol (583737) | about 8 months ago | (#44650949)

That is why my laptop sd-card reader is not working when I close the lid... until reboot. F!*$&%" usb...

Re:It explains a lot! (0, Troll)

smash (1351) | about 8 months ago | (#44651381)

Works for me. Oh, you're running Linux? :)

Re:It explains a lot! (2)

gagol (583737) | about 8 months ago | (#44651409)

Yeah, laugh all you want, it is the only issue I had with linux in 8 years... I saw much more trouble on Windows PC's at work/friends. Byut you know what? I dont care if you prefer Windows, Linux or even Mac! Not everybody likes playing guitar, not everybody have the same needs. That being said, I prefer a defective sd card reader than running Windows 8 anyday.

Re:It explains a lot! (1)

Anonymous Coward | about 8 months ago | (#44651587)

I've seen several SD readers that don't recover from suspend or hibernate, on *Windows*; I never assumed it was Windows' fault.
I also have a notebook at work that doesn't hibernate on Windows, but does on Linux :-/

BTW please do a little experiment: change some USB port of some of your devices and count how many seconds Windows takes to reconfigure the device; on Linux, it's always instantaneous. Who's laughing now?

See, females can be usefull too (-1)

Anonymous Coward | about 8 months ago | (#44651073)

When not rambling about feminism.

Everybody else knows this (1)

Tablizer (95088) | about 8 months ago | (#44651101)

See, a non-geek would know that you have to wait for a while before you ask the same girl out again after a failure to connect the first time.

Automatic driver synthesis (1)

FithisUX (855293) | about 8 months ago | (#44651701)

Normally one could write the USB spec (lets say X spec) in a high level language (that specifies behavior, say HLL) as a reference implementation that could be taken by the OS (any OS) to derive the driver. This spec should be provided by the X standards body (could b even a company) . Moreover it could interface to Y spec in the same high level language and still generate a X:Y composite driver or even create two drivers at kernel level that interface with some OS specific way. The standards body could verify X or X:Y for correct operation and publish it along with the PDF spec. The problem is that many people believe that the knowledge of C or some kernel internals are a form of qualification when we live in 2013. The real qualification is to create the HLL to kernel interface translator. Science is lacking from software in many many circumstances. Companies, selfish programmers f@^(ing money are to blame. But the problem is that OSes far better than commercial ones fail because of lack of drivers. Or equivalently by the lack of mapping the spec to their kernel interface in a hand-written time consuming error prone way due to complexity. The big thing is how to write the kernel (or the microkernel) to support apps known as drivers .... among others. We have functional, logic and functional logic languages. But we still live in caves imposed by companies and incompetent programmers that act like priests in ancient Egypt and companies that cheat on their customers. The above article shows a big symptom of a deep problem in CS. It is lack of professionalism, lack of scientific method and lack of freedom. The HW companies should only sell hardware accompanied with documentation. They should not be allowed to give drivers for an OS which poses a competitive advantage to a company. It should be illegal. This is not about OSS, its about common sense. However the UEFI secure boot and recent NSA story say something different. It says that there are no government entities willing to pose limits on the power of companies. Instead they fuel them. The paradox arising is that in 2013 many develop like in 70s. It is a form of autism, it is a kind of slavery, it is a sign of decay.

Year of Linux on the deskop (0)

Anonymous Coward | about 8 months ago | (#44651707)

Please, somebody fix this fast. Otherwise 2014 may not be the year of Linux on the desktop with these crappy USB problems. End users shouldn't have to patch and recompile their kernel IMO.

Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...