Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Oct 2014, 03:48
All times are UTC - 4
 Forum index » Taking the Puppy out for a walk » Announcements
USB disconnects on resume can be caused by Linux Kernel bug
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
darkcity


Joined: 23 May 2010
Posts: 2462
Location: near here

PostPosted: Thu 22 Aug 2013, 09:42    Post_subject:  USB disconnects on resume can be caused by Linux Kernel bug  

Sarah Sharp-
Quote:
Facepalm. Linux may have been causing USB disconnects on resume from device suspend all along.

Pretty much for my entire career in Linux USB (eight years now?), we've been complaining about how USB device power management just sucks. We enable auto-suspend for a USB device driver, and find dozens of different USB devices that simply disconnect from the bus when auto-suspend is enabled.

For years, we've blamed those devices for being cheap, crappy, and broken. We talked about blacklists in the kernel, and ripped those out when they got too big. We've talked about whitelists in userspace, but not many distros have time to cultivate such lists.

It turns out it's not always the device's fault.

There's a 10 ms timeout in the USB core, with a simple comment over it "TRSMRCY = 10 msec". And indeed, in the USB 2.0 spec, section 7.1.7.7, the spec states "The USB System Software must provide a 10 ms resume recovery time (TRSMRCY) during which it will not attempt to access any device connected to the affected (just-activated) bus segment."

A software developer would say, "Ok, that means I can access the device after I wait 10 ms." However, a hardware developer would take a careful look at Table 7-14 and notice TRSMRCY is listed as a minimum value.

That means the USB ports can be in resume for longer than TRSMRCY. If the USB core attempts to access those ports while the device is still coming out of resume, such as issuing transfers to the device, or resetting the port, the device will disconnect, or transfer errors will occur. This causes the USB core to mark the device as disconnected.

It's easy to see that TRSMRCY varies on an Intel xHCI host controller by adding some extra debugging. The Intel xHCI host, unlike the EHCI host, actually gives an interrupt when the port fully transitions to the active state. The maximum time I've seen is around 17 ms, and the time is above 10 ms in about 8% of the remote wakeup events I've tested.

This patch is not the "real fix" for solving the issues with the USB core, and despise fixing things by tweaking timeout values, so I'll have to work on a real fix tomorrow. But at least there's a light at the end of the tunnel for USB device power management.

https://plus.google.com/u/0/116960357493251979546/posts/RZpndv4BCCD

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send_private_message Visit_website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Thu 22 Aug 2013, 09:55    Post_subject:  

That feature normally is not enabled in standard Puppy kernels .
It has to be enabled to take effect .
I have enabled it once and immediately the USB keyboard went asleep and was not able to wake it up again .
Disgusting, since it was a normal Pc with only USB connectors ( no PS/2 ) .

Dunno what kernel version it had been .
Back to top
View user's profile Send_private_message Visit_website 
darkcity


Joined: 23 May 2010
Posts: 2462
Location: near here

PostPosted: Thu 22 Aug 2013, 10:16    Post_subject:  

I knew there had been problems with various USB devices and Power saving.

Now the bug has been found it may allow some additional power saving features into new Puppies Very Happy

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Taking the Puppy out for a walk » Announcements
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0551s ][ Queries: 11 (0.0121s) ][ GZIP on ]