]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
USB: try to salvage lost power sessions
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 28 Apr 2008 15:06:55 +0000 (11:06 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 21 Jul 2008 22:15:51 +0000 (15:15 -0700)
commit8808f00c7adfc8dc0b797c34ec03490b237fce4e
tree0062a4de8f9957faa51b96bb17351c3ca48c41a1
parent6ee0b270c733027b2b716b1c80b9aced41e08d20
USB: try to salvage lost power sessions

This patch (as1073) adds to khubd a way to recover from power-session
interruption caused by transient connect-change or enable-change
events.  After the debouncing period, khubd attempts to do a
USB-Persist-style reset or reset-resume.  If it works, the connection
will remain unscathed.

The upshot is that we will be more immune to noise caused by EMI.  The
grace period is on the order of 100 ms, so this won't permit recovery
from the "accidentally knocked the USB cable out of its socket" type
of event, but it's a start.

As an added bonus, if a device was suspended when the system goes to
sleep then we no longer need to check for power-session interruptions
when the system wakes up.  Khubd will naturally see the status change
while processing the device's parent hub and will do the right thing.

The remote_wakeup() routine is changed; now it expects the caller to
acquire the device lock rather than acquiring the lock itself.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/core/driver.c
drivers/usb/core/hub.c