diff options
author | Jiri Kosina <jkosina@suse.cz> | 2011-07-11 08:15:48 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-07-11 08:15:55 -0400 |
commit | b7e9c223be8ce335e30f2cf6ba588e6a4092275c (patch) | |
tree | 2d1e3b75606abc18df7ad65e51ac3f90cd68b38d /drivers/usb/core/hub.c | |
parent | c172d82500a6cf3c32d1e650722a1055d72ce858 (diff) | |
parent | e3bbfa78bab125f58b831b5f7f45b5a305091d72 (diff) |
Merge branch 'master' into for-next
Sync with Linus' tree to be able to apply pending patches that
are based on newer code already present upstream.
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r-- | drivers/usb/core/hub.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 90ae1753dda1..a428aa080a36 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1634,6 +1634,7 @@ void usb_disconnect(struct usb_device **pdev) | |||
1634 | { | 1634 | { |
1635 | struct usb_device *udev = *pdev; | 1635 | struct usb_device *udev = *pdev; |
1636 | int i; | 1636 | int i; |
1637 | struct usb_hcd *hcd = bus_to_hcd(udev->bus); | ||
1637 | 1638 | ||
1638 | if (!udev) { | 1639 | if (!udev) { |
1639 | pr_debug ("%s nodev\n", __func__); | 1640 | pr_debug ("%s nodev\n", __func__); |
@@ -1661,7 +1662,9 @@ void usb_disconnect(struct usb_device **pdev) | |||
1661 | * so that the hardware is now fully quiesced. | 1662 | * so that the hardware is now fully quiesced. |
1662 | */ | 1663 | */ |
1663 | dev_dbg (&udev->dev, "unregistering device\n"); | 1664 | dev_dbg (&udev->dev, "unregistering device\n"); |
1665 | mutex_lock(hcd->bandwidth_mutex); | ||
1664 | usb_disable_device(udev, 0); | 1666 | usb_disable_device(udev, 0); |
1667 | mutex_unlock(hcd->bandwidth_mutex); | ||
1665 | usb_hcd_synchronize_unlinks(udev); | 1668 | usb_hcd_synchronize_unlinks(udev); |
1666 | 1669 | ||
1667 | usb_remove_ep_devs(&udev->ep0); | 1670 | usb_remove_ep_devs(&udev->ep0); |
@@ -2362,6 +2365,10 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg) | |||
2362 | USB_DEVICE_REMOTE_WAKEUP, 0, | 2365 | USB_DEVICE_REMOTE_WAKEUP, 0, |
2363 | NULL, 0, | 2366 | NULL, 0, |
2364 | USB_CTRL_SET_TIMEOUT); | 2367 | USB_CTRL_SET_TIMEOUT); |
2368 | |||
2369 | /* System sleep transitions should never fail */ | ||
2370 | if (!(msg.event & PM_EVENT_AUTO)) | ||
2371 | status = 0; | ||
2365 | } else { | 2372 | } else { |
2366 | /* device has up to 10 msec to fully suspend */ | 2373 | /* device has up to 10 msec to fully suspend */ |
2367 | dev_dbg(&udev->dev, "usb %ssuspend\n", | 2374 | dev_dbg(&udev->dev, "usb %ssuspend\n", |
@@ -2611,16 +2618,15 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg) | |||
2611 | struct usb_device *hdev = hub->hdev; | 2618 | struct usb_device *hdev = hub->hdev; |
2612 | unsigned port1; | 2619 | unsigned port1; |
2613 | 2620 | ||
2614 | /* fail if children aren't already suspended */ | 2621 | /* Warn if children aren't already suspended */ |
2615 | for (port1 = 1; port1 <= hdev->maxchild; port1++) { | 2622 | for (port1 = 1; port1 <= hdev->maxchild; port1++) { |
2616 | struct usb_device *udev; | 2623 | struct usb_device *udev; |
2617 | 2624 | ||
2618 | udev = hdev->children [port1-1]; | 2625 | udev = hdev->children [port1-1]; |
2619 | if (udev && udev->can_submit) { | 2626 | if (udev && udev->can_submit) { |
2620 | if (!(msg.event & PM_EVENT_AUTO)) | 2627 | dev_warn(&intf->dev, "port %d nyet suspended\n", port1); |
2621 | dev_dbg(&intf->dev, "port %d nyet suspended\n", | 2628 | if (msg.event & PM_EVENT_AUTO) |
2622 | port1); | 2629 | return -EBUSY; |
2623 | return -EBUSY; | ||
2624 | } | 2630 | } |
2625 | } | 2631 | } |
2626 | 2632 | ||