usb: xhci: Add quirk to enable U1/U2
Krishna Yarlagadda [Thu, 8 Jan 2015 10:29:42 +0000 (15:29 +0530)]
Add a quirk to enable U1/U2 to a known list
of bad devices.

Bug 200036929

Change-Id: I73982e37e995ab93e40bf344cf5adac2b5cb79fc
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-on: http://git-master/r/670632
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>

drivers/usb/core/hub.c
drivers/usb/core/quirks.c
include/linux/usb/quirks.h

index cc245bb..a62aab2 100644 (file)
@@ -3977,6 +3977,9 @@ void usb_enable_lpm(struct usb_device *udev)
                        udev->state < USB_STATE_DEFAULT)
                return;
 
+       if (!(udev->quirks & USB_QUIRK_ENABLE_U1U2))
+               return;
+
        udev->lpm_disable_count--;
        hcd = bus_to_hcd(udev->bus);
        /* Double check that we can both enable and disable LPM.
index 694d16b..289bf6e 100644 (file)
@@ -160,6 +160,9 @@ static const struct usb_device_id usb_quirk_list[] = {
        /* Protocol and OTG Electrical Test Device */
        { USB_DEVICE(0x1a0a, 0x0200), .driver_info = USB_QUIRK_OTG_COMPLIANCE },
 
+       /* Sandisk Extreme USB 3.0 64GB */
+       { USB_DEVICE(0x0781, 0x5580), .driver_info = USB_QUIRK_ENABLE_U1U2 },
+
        { }  /* terminating entry must be last */
 };
 
index 41ffd6f..3c706f2 100644 (file)
@@ -35,4 +35,7 @@
 
 #define USB_QUIRK_OTG_COMPLIANCE       0x00000080
 
+/* device can handle u1/u2 power states well */
+#define USB_QUIRK_ENABLE_U1U2          0x00000400
+
 #endif /* __LINUX_USB_QUIRKS_H */