diff options
author | Ming Lei <ming.lei@canonical.com> | 2012-10-23 23:59:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-25 14:45:32 -0400 |
commit | 596d789a211d134dc5f94d1e5957248c204ef850 (patch) | |
tree | 6ffb0552cde7a5d607119251a337d66c583a9362 /drivers/usb/core/hub.c | |
parent | e6f30deafe61179df048ac9040fe2bdf73a996c3 (diff) |
USB: set hub's default autosuspend delay as 0
This patch sets hub device's default autosuspend delay as 0 to
speedup bus suspend, see comments in code for details.
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r-- | drivers/usb/core/hub.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index ff86355d0dfc..43ce1467f8c0 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1614,6 +1614,41 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1614 | desc = intf->cur_altsetting; | 1614 | desc = intf->cur_altsetting; |
1615 | hdev = interface_to_usbdev(intf); | 1615 | hdev = interface_to_usbdev(intf); |
1616 | 1616 | ||
1617 | /* | ||
1618 | * Set default autosuspend delay as 0 to speedup bus suspend, | ||
1619 | * based on the below considerations: | ||
1620 | * | ||
1621 | * - Unlike other drivers, the hub driver does not rely on the | ||
1622 | * autosuspend delay to provide enough time to handle a wakeup | ||
1623 | * event, and the submitted status URB is just to check future | ||
1624 | * change on hub downstream ports, so it is safe to do it. | ||
1625 | * | ||
1626 | * - The patch might cause one or more auto supend/resume for | ||
1627 | * below very rare devices when they are plugged into hub | ||
1628 | * first time: | ||
1629 | * | ||
1630 | * devices having trouble initializing, and disconnect | ||
1631 | * themselves from the bus and then reconnect a second | ||
1632 | * or so later | ||
1633 | * | ||
1634 | * devices just for downloading firmware, and disconnects | ||
1635 | * themselves after completing it | ||
1636 | * | ||
1637 | * For these quite rare devices, their drivers may change the | ||
1638 | * autosuspend delay of their parent hub in the probe() to one | ||
1639 | * appropriate value to avoid the subtle problem if someone | ||
1640 | * does care it. | ||
1641 | * | ||
1642 | * - The patch may cause one or more auto suspend/resume on | ||
1643 | * hub during running 'lsusb', but it is probably too | ||
1644 | * infrequent to worry about. | ||
1645 | * | ||
1646 | * - Change autosuspend delay of hub can avoid unnecessary auto | ||
1647 | * suspend timer for hub, also may decrease power consumption | ||
1648 | * of USB bus. | ||
1649 | */ | ||
1650 | pm_runtime_set_autosuspend_delay(&hdev->dev, 0); | ||
1651 | |||
1617 | /* Hubs have proper suspend/resume support. */ | 1652 | /* Hubs have proper suspend/resume support. */ |
1618 | usb_enable_autosuspend(hdev); | 1653 | usb_enable_autosuspend(hdev); |
1619 | 1654 | ||