Skip to content

Commit

Permalink
USB: shutdown all URBs after controller death
Browse files Browse the repository at this point in the history
When a host controller dies, we don't need to wait for a driver to
time out.  We can shut down its URBs immediately.  Without this
change, we can end up waiting 30 seconds for a mass-storage transfer
to time out.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jul 17, 2014
1 parent 46865bf commit 1299cff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/usb/core/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,11 @@ static int usb_unbind_interface(struct device *dev)
*/
lpm_disable_error = usb_unlocked_disable_lpm(udev);

/* Terminate all URBs for this interface unless the driver
* supports "soft" unbinding.
/*
* Terminate all URBs for this interface unless the driver
* supports "soft" unbinding and the device is still present.
*/
if (!driver->soft_unbind)
if (!driver->soft_unbind || udev->state == USB_STATE_NOTATTACHED)
usb_disable_interface(udev, intf, false);

driver->disconnect(intf);
Expand Down

0 comments on commit 1299cff

Please sign in to comment.