diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2008-10-21 15:40:03 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-10-22 13:05:29 -0400 |
commit | 6c6409459a18a825ce12ecb003d5686af61f7a2f (patch) | |
tree | f28fec32ce7a7a5c6ce0b4df41cd39a4fee27622 | |
parent | a496c64f1363ec4d67ebdc1e1f619ad6372a574c (diff) |
USB: don't rebind drivers after failed resume or reset
This patch (as1152) may help prevent some problems associated with the
new policy of unbinding drivers that don't support suspend/resume or
pre_reset/post_reset. If for any reason the resume or reset fails, and
the device is logically disconnected, there's no point in trying to
rebind the driver. So the patch checks for success before carrying
out the unbind/rebind.
There was a report from one user that this fixed a problem he was
experiencing, but the details never became fully clear. In any case,
adding these tests can't hurt.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/core/driver.c | 3 | ||||
-rw-r--r-- | drivers/usb/core/hub.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index e935be7eb468..3d7793d93031 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -1610,7 +1610,8 @@ int usb_external_resume_device(struct usb_device *udev) | |||
1610 | status = usb_resume_both(udev); | 1610 | status = usb_resume_both(udev); |
1611 | udev->last_busy = jiffies; | 1611 | udev->last_busy = jiffies; |
1612 | usb_pm_unlock(udev); | 1612 | usb_pm_unlock(udev); |
1613 | do_unbind_rebind(udev, DO_REBIND); | 1613 | if (status == 0) |
1614 | do_unbind_rebind(udev, DO_REBIND); | ||
1614 | 1615 | ||
1615 | /* Now that the device is awake, we can start trying to autosuspend | 1616 | /* Now that the device is awake, we can start trying to autosuspend |
1616 | * it again. */ | 1617 | * it again. */ |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index d73ce262c365..9b3f16bd12cb 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -3504,7 +3504,7 @@ int usb_reset_device(struct usb_device *udev) | |||
3504 | USB_INTERFACE_BOUND) | 3504 | USB_INTERFACE_BOUND) |
3505 | rebind = 1; | 3505 | rebind = 1; |
3506 | } | 3506 | } |
3507 | if (rebind) | 3507 | if (ret == 0 && rebind) |
3508 | usb_rebind_intf(cintf); | 3508 | usb_rebind_intf(cintf); |
3509 | } | 3509 | } |
3510 | } | 3510 | } |