Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317039
b: refs/heads/master
c: 9cf6599
h: refs/heads/master
i:
  317037: d2363b3
  317035: 49ea063
  317031: 5c1e8dc
  317023: f38674a
v: v3
  • Loading branch information
Sarah Sharp committed Jul 11, 2012
1 parent f583e45 commit 4432668
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 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: 6d1d051330ee096f575523647fbd8ffe703600b5
refs/heads/master: 9cf65991dd93ac3d5f97f536171c388918b7c1a9
7 changes: 4 additions & 3 deletions trunk/drivers/usb/core/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1792,14 +1792,15 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
* installed, so that the xHCI driver can recalculate the U1/U2
* timeouts.
*/
if (usb_disable_lpm(dev)) {
if (dev->actconfig && usb_disable_lpm(dev)) {
dev_err(&dev->dev, "%s Failed to disable LPM\n.", __func__);
mutex_unlock(hcd->bandwidth_mutex);
return -ENOMEM;
}
ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL);
if (ret < 0) {
usb_enable_lpm(dev);
if (dev->actconfig)
usb_enable_lpm(dev);
mutex_unlock(hcd->bandwidth_mutex);
usb_autosuspend_device(dev);
goto free_interfaces;
Expand All @@ -1819,7 +1820,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
if (!cp) {
usb_set_device_state(dev, USB_STATE_ADDRESS);
usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
usb_enable_lpm(dev);
/* Leave LPM disabled while the device is unconfigured. */
mutex_unlock(hcd->bandwidth_mutex);
usb_autosuspend_device(dev);
goto free_interfaces;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/usb/core/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
dev->dev.dma_mask = bus->controller->dma_mask;
set_dev_node(&dev->dev, dev_to_node(bus->controller));
dev->state = USB_STATE_ATTACHED;
dev->lpm_disable_count = 1;
atomic_set(&dev->urbnum, 0);

INIT_LIST_HEAD(&dev->ep0.urb_list);
Expand Down

0 comments on commit 4432668

Please sign in to comment.