]> git.baikalelectronics.ru Git - kernel.git/commit
USB: fix race in autosuspend reschedule
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 11 Oct 2007 20:47:36 +0000 (16:47 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 12 Oct 2007 21:55:35 +0000 (14:55 -0700)
commitcc53508da45199d9ee288715b64e4aea6b3a0899
tree1ad0e6ead73cccc43dd1c1997aabb25acb4970d2
parent6a7a013aeb9d2538e905f05214cf1efd90c228ca
USB: fix race in autosuspend reschedule

This patch (as1002) fixes a small race which can occur when a driver
expects usbcore to reschedule an autosuspend request.  If the request
arrives too late, it won't be rescheduled.  The patch adds an extra
argument to autosuspend_check(), indicating that a reschedule is
needed no matter how much time has elapsed.

It also tries to avoid letting asynchronous changes to the value of
jiffies cause a delay to become negative, by caching a local copy of
the current time.

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