summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorThierry Strudel <tstrudel@google.com>2018-05-09 11:36:40 -0700
committerMichael Bestas <mkbestas@lineageos.org>2019-12-23 23:43:36 +0200
commit66fed85fe941e850dc57969b8a545f6f9308a729 (patch)
tree8db8e86eff9fa327cbd12df617158c137e8f7516 /drivers/usb
parent643282a43bfc2586f0867f57e53dfb618bee6590 (diff)
Revert "usb: hub: Prevent hub autosuspend if usbcore.autosuspend is -1"
Certain USB-C devices are failing to enumerate if the bus transitions from active to suspend between connection and enumeration. When a USB-C accessory is inserted in a phone and is detected by the CC lines, the controller driver is loaded and the only devices present on the bus are the root hubs, until the device enumerations. As a result, a suspend transition between device connection and enumeration is very likely. This change leaves the hub autosuspend set to the usbcore.autosuspend value so a value can be set high enough to prevent this race. This reverts: commit bdd405d2a528 ("usb: hub: Prevent hub autosuspend if usbcore.autosuspend is -1") If user specifies that USB autosuspend must be disabled by module parameter "usbcore.autosuspend=-1" then we must prevent autosuspend of USB hub devices as well. commit 596d789a211d introduced in v3.8 changed the original behaivour and stopped respecting the usbcore.autosuspend parameter for hubs. Bug: 71936484 Change-Id: Ie20471b9e8d44f92f9eff97ed12ccd903c98c272 Signed-off-by: Thierry Strudel <tstrudel@google.com> Signed-off-by: Andrew Chant <achant@google.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/hub.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 655279ed6dba..c0817edc4903 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1722,14 +1722,8 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
* - Change autosuspend delay of hub can avoid unnecessary auto
* suspend timer for hub, also may decrease power consumption
* of USB bus.
- *
- * - If user has indicated to prevent autosuspend by passing
- * usbcore.autosuspend = -1 then keep autosuspend disabled.
*/
-#ifdef CONFIG_PM
- if (hdev->dev.power.autosuspend_delay >= 0)
- pm_runtime_set_autosuspend_delay(&hdev->dev, 0);
-#endif
+ pm_runtime_set_autosuspend_delay(&hdev->dev, 0);
/*
* Hubs have proper suspend/resume support, except for root hubs