diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2008-10-23 17:35:07 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-10-25 14:32:38 -0700 |
commit | 1769c339cde4c1da819ee97513e9340413cef3c5 (patch) | |
tree | b119ced03a23be63cdd2db035d8b1bc0b38839d9 /drivers | |
parent | 8cece7795b1c359787261a150ac502b250c6699f (diff) | |
download | lwn-1769c339cde4c1da819ee97513e9340413cef3c5.tar.gz lwn-1769c339cde4c1da819ee97513e9340413cef3c5.zip |
USB: don't rebind drivers after failed resume or reset
commit 6c6409459a18a825ce12ecb003d5686af61f7a2f upstream
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-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 5a7fa6f09958..9f42cb8bbe48 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -1609,7 +1609,8 @@ int usb_external_resume_device(struct usb_device *udev) status = usb_resume_both(udev); udev->last_busy = jiffies; usb_pm_unlock(udev); - do_unbind_rebind(udev, DO_REBIND); + if (status == 0) + do_unbind_rebind(udev, DO_REBIND); /* Now that the device is awake, we can start trying to autosuspend * it again. */ diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index d99963873e37..875de9a7aa0f 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -3424,7 +3424,7 @@ int usb_reset_device(struct usb_device *udev) USB_INTERFACE_BOUND) rebind = 1; } - if (rebind) + if (ret == 0 && rebind) usb_rebind_intf(cintf); } } |