USB: Disable auto-suspend for USB 3.0 hubs.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Thu, 30 Dec 2010 21:27:36 +0000 (13:27 -0800)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Mon, 14 Mar 2011 01:23:51 +0000 (18:23 -0700)
USB 3.0 devices have a slightly different suspend sequence than USB
2.0/1.1 devices.  There isn't support for USB 3.0 device suspend yet, so
make khubd leave autosuspend disabled for USB 3.0 hubs.  Make sure that
USB 3.0 roothubs still have autosuspend enabled, since that path in the
xHCI driver works fine.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/core/hub.c

index 13aafd1..0968157 100644 (file)
@@ -1290,8 +1290,14 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
        desc = intf->cur_altsetting;
        hdev = interface_to_usbdev(intf);
 
-       /* Hubs have proper suspend/resume support */
-       usb_enable_autosuspend(hdev);
+       /* Hubs have proper suspend/resume support.  USB 3.0 device suspend is
+        * different from USB 2.0/1.1 device suspend, and unfortunately we
+        * don't support it yet.  So leave autosuspend disabled for USB 3.0
+        * external hubs for now.  Enable autosuspend for USB 3.0 roothubs,
+        * since that isn't a "real" hub.
+        */
+       if (!hub_is_superspeed(hdev) || !hdev->parent)
+               usb_enable_autosuspend(hdev);
 
        if (hdev->level == MAX_TOPO_LEVEL) {
                dev_err(&intf->dev,