From: Alan Stern Date: Thu, 17 Jul 2014 19:40:57 +0000 (-0400) Subject: USB: shutdown all URBs after controller death X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1299cff9fa39811cd1b3f1731527b062425f0541;p=linux-beck.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 4aeb10034de7..9bffd26cea05 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c @@ -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);