usb: core: hub: add quirk for hub with broken autosuspend function
authorWilliam Wu <wulf@rock-chips.com>
Tue, 21 Feb 2017 08:02:36 +0000 (16:02 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 22 Feb 2017 06:16:04 +0000 (14:16 +0800)
Some USB host controller seems to have problems with
autosuspend. For example, Rockchip rk3328 SoC USB 3.0
wouldn't handle remote wakeup correctly with external
hub after entered autosuspend, caused to resume SS
port fail.

This patch introduces a new quirk flag for hub that
should remain disabled for autosuspend.

Change-Id: I6d14222b2c5025583fea811a6afd6abd22f41cb9
Signed-off-by: William Wu <wulf@rock-chips.com>
drivers/usb/core/hub.c
include/linux/usb/quirks.h

index 00dd717e65bba7f24d150ce5af16ad1a30c58d71..b9195e242cca5bfda94caed80ee3cc5a2d3427ab 100644 (file)
@@ -1711,7 +1711,8 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
         * bus_resume methods.
         */
        if (hdev->parent) {             /* normal device */
-               usb_enable_autosuspend(hdev);
+               if (!(hdev->parent->quirks & USB_QUIRK_AUTO_SUSPEND))
+                       usb_enable_autosuspend(hdev);
        } else {                        /* root hub */
                const struct hc_driver *drv = bus_to_hcd(hdev->bus)->driver;
 
index 1d0043dc34e427403a1c82458249bed83e87d3a0..56939098675ef0ce0f9b25596be7b76838f15f85 100644 (file)
@@ -50,4 +50,7 @@
 /* device can't handle Link Power Management */
 #define USB_QUIRK_NO_LPM                       BIT(10)
 
+/* device can't support auto suspend function */
+#define USB_QUIRK_AUTO_SUSPEND                 BIT(11)
+
 #endif /* __LINUX_USB_QUIRKS_H */