usb: core: hub: add quirk for hub with broken autosuspend function

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>
This commit is contained in:
William Wu
2017-02-21 16:02:36 +08:00
committed by William Wu
parent caa12b70cc
commit 940685bbde
2 changed files with 5 additions and 1 deletions

View File

@@ -1770,7 +1770,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;

View File

@@ -69,4 +69,7 @@
/* Hub needs extra delay after resetting its port. */
#define USB_QUIRK_HUB_SLOW_RESET BIT(14)
/* device can't support auto suspend function */
#define USB_QUIRK_AUTO_SUSPEND BIT(15)
#endif /* __LINUX_USB_QUIRKS_H */