diff options
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r-- | drivers/usb/core/hub.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index fdb62ca10d8..b98efae6a1c 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1803,9 +1803,15 @@ int usb_new_device(struct usb_device *udev) | |||
1803 | 1803 | ||
1804 | /* Tell the runtime-PM framework the device is active */ | 1804 | /* Tell the runtime-PM framework the device is active */ |
1805 | pm_runtime_set_active(&udev->dev); | 1805 | pm_runtime_set_active(&udev->dev); |
1806 | pm_runtime_get_noresume(&udev->dev); | ||
1806 | pm_runtime_use_autosuspend(&udev->dev); | 1807 | pm_runtime_use_autosuspend(&udev->dev); |
1807 | pm_runtime_enable(&udev->dev); | 1808 | pm_runtime_enable(&udev->dev); |
1808 | 1809 | ||
1810 | /* By default, forbid autosuspend for all devices. It will be | ||
1811 | * allowed for hubs during binding. | ||
1812 | */ | ||
1813 | usb_disable_autosuspend(udev); | ||
1814 | |||
1809 | err = usb_enumerate_device(udev); /* Read descriptors */ | 1815 | err = usb_enumerate_device(udev); /* Read descriptors */ |
1810 | if (err < 0) | 1816 | if (err < 0) |
1811 | goto fail; | 1817 | goto fail; |
@@ -1831,6 +1837,8 @@ int usb_new_device(struct usb_device *udev) | |||
1831 | } | 1837 | } |
1832 | 1838 | ||
1833 | (void) usb_create_ep_devs(&udev->dev, &udev->ep0, udev); | 1839 | (void) usb_create_ep_devs(&udev->dev, &udev->ep0, udev); |
1840 | usb_mark_last_busy(udev); | ||
1841 | pm_runtime_put_sync_autosuspend(&udev->dev); | ||
1834 | return err; | 1842 | return err; |
1835 | 1843 | ||
1836 | fail: | 1844 | fail: |
@@ -2221,6 +2229,7 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg) | |||
2221 | usb_set_device_state(udev, USB_STATE_SUSPENDED); | 2229 | usb_set_device_state(udev, USB_STATE_SUSPENDED); |
2222 | msleep(10); | 2230 | msleep(10); |
2223 | } | 2231 | } |
2232 | usb_mark_last_busy(hub->hdev); | ||
2224 | return status; | 2233 | return status; |
2225 | } | 2234 | } |
2226 | 2235 | ||