diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-02-25 22:10:38 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-02-25 22:10:38 +0000 |
commit | 9f33be2c3a80bdc2cc08342dd77fac87652e0548 (patch) | |
tree | 7ad6e825427a15c5ec0fc15540abc0429d7f4bce /drivers/usb/core/hcd.c | |
parent | 2741ecb4ce5c2d430b5c44b0a169038338c21df5 (diff) | |
parent | eed18b5fa4d297c681b00144e8c6942dd35d39a7 (diff) | |
download | kernel_samsung_smdk4412-9f33be2c3a80bdc2cc08342dd77fac87652e0548.zip kernel_samsung_smdk4412-9f33be2c3a80bdc2cc08342dd77fac87652e0548.tar.gz kernel_samsung_smdk4412-9f33be2c3a80bdc2cc08342dd77fac87652e0548.tar.bz2 |
Merge branches 'clks' and 'pnx' into devel
Diffstat (limited to 'drivers/usb/core/hcd.c')
-rw-r--r-- | drivers/usb/core/hcd.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 0495fa6..80995ef 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -1684,6 +1684,24 @@ int usb_hcd_alloc_bandwidth(struct usb_device *udev, } } if (cur_alt && new_alt) { + struct usb_interface *iface = usb_ifnum_to_if(udev, + cur_alt->desc.bInterfaceNumber); + + if (iface->resetting_device) { + /* + * The USB core just reset the device, so the xHCI host + * and the device will think alt setting 0 is installed. + * However, the USB core will pass in the alternate + * setting installed before the reset as cur_alt. Dig + * out the alternate setting 0 structure, or the first + * alternate setting if a broken device doesn't have alt + * setting 0. + */ + cur_alt = usb_altnum_to_altsetting(iface, 0); + if (!cur_alt) + cur_alt = &iface->altsetting[0]; + } + /* Drop all the endpoints in the current alt setting */ for (i = 0; i < cur_alt->desc.bNumEndpoints; i++) { ret = hcd->driver->drop_endpoint(hcd, udev, |