usb: hub: Prevent hub autosuspend if usbcore.autosuspend is -1
[profile/ivi/kernel-x86-ivi.git] / drivers / usb / core / hub.c
index 5607dce..d098bcf 100644 (file)
@@ -1695,8 +1695,12 @@ 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.
         */
-       pm_runtime_set_autosuspend_delay(&hdev->dev, 0);
+       if (hdev->dev.power.autosuspend_delay >= 0)
+               pm_runtime_set_autosuspend_delay(&hdev->dev, 0);
 
        /*
         * Hubs have proper suspend/resume support, except for root hubs