Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133545
b: refs/heads/master
c: 4fe0387
h: refs/heads/master
i:
  133543: d62f66d
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Mar 24, 2009
1 parent 515a21b commit aeac23e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 77aa2b5878f48d6ab6e0c412cc9214c845483475
refs/heads/master: 4fe0387afa893b44c5a21b9bfbb0888354ef4656
23 changes: 16 additions & 7 deletions trunk/drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -3393,10 +3393,10 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
udev->descriptor = descriptor; /* for disconnect() calls */
goto re_enumerate;
}


/* Restore the device's previous configuration */
if (!udev->actconfig)
goto done;

ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
USB_REQ_SET_CONFIGURATION, 0,
udev->actconfig->desc.bConfigurationValue, 0,
Expand All @@ -3409,16 +3409,25 @@ static int usb_reset_and_verify_device(struct usb_device *udev)
}
usb_set_device_state(udev, USB_STATE_CONFIGURED);

/* Put interfaces back into the same altsettings as before.
* Don't bother to send the Set-Interface request for interfaces
* that were already in altsetting 0; besides being unnecessary,
* many devices can't handle it. Instead just reset the host-side
* endpoint state.
*/
for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) {
struct usb_interface *intf = udev->actconfig->interface[i];
struct usb_interface_descriptor *desc;

/* set_interface resets host side toggle even
* for altsetting zero. the interface may have no driver.
*/
desc = &intf->cur_altsetting->desc;
ret = usb_set_interface(udev, desc->bInterfaceNumber,
desc->bAlternateSetting);
if (desc->bAlternateSetting == 0) {
usb_disable_interface(udev, intf, true);
usb_enable_interface(udev, intf, true);
ret = 0;
} else {
ret = usb_set_interface(udev, desc->bInterfaceNumber,
desc->bAlternateSetting);
}
if (ret < 0) {
dev_err(&udev->dev, "failed to restore interface %d "
"altsetting %d (error=%d)\n",
Expand Down

0 comments on commit aeac23e

Please sign in to comment.