Skip to content

Commit 1299cff

Browse files
AlanSterngregkh
authored andcommitted
USB: shutdown all URBs after controller death
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 46865bf commit 1299cff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/usb/core/driver.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,11 @@ static int usb_unbind_interface(struct device *dev)
417417
*/
418418
lpm_disable_error = usb_unlocked_disable_lpm(udev);
419419

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

426427
driver->disconnect(intf);

0 commit comments

Comments
 (0)