Skip to content

Commit ae8963a

Browse files
author
Sarah Sharp
committed
usb: Don't enable LPM if the exit latency is zero.
Some USB 3.0 devices signal that they don't implement Link PM by having all zeroes in the U1/U2 exit latencies in their SuperSpeed BOS descriptor. Don found that a Western Digital device he has experiences transfer errors when LPM is enabled. The lsusb shows the U1/U2 exit latencies are set to zero: Binary Object Store Descriptor: bLength 5 bDescriptorType 15 wTotalLength 22 bNumDeviceCaps 2 SuperSpeed USB Device Capability: bLength 10 bDescriptorType 16 bDevCapabilityType 3 bmAttributes 0x00 Latency Tolerance Messages (LTM) Supported wSpeedsSupported 0x000e Device can operate at Full Speed (12Mbps) Device can operate at High Speed (480Mbps) Device can operate at SuperSpeed (5Gbps) bFunctionalitySupport 1 Lowest fully-functional device speed is Full Speed (12Mbps) bU1DevExitLat 0 micro seconds bU2DevExitLat 0 micro seconds The fix is to not enable LPM for a particular link state if we find its corresponding exit latency is zero. This patch should be backported to kernels as old as 3.5, that contain the commit 1ea7e0e "USB: Add support to enable/disable USB3 link states." Signed-off-by: Sarah Sharp <[email protected]> Reported-by: Don Zickus <[email protected]> Tested-by: Don Zickus <[email protected]> Cc: [email protected]
1 parent d01f87c commit ae8963a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/usb/core/hub.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3415,6 +3415,16 @@ static void usb_enable_link_state(struct usb_hcd *hcd, struct usb_device *udev,
34153415
enum usb3_link_state state)
34163416
{
34173417
int timeout;
3418+
__u8 u1_mel = udev->bos->ss_cap->bU1devExitLat;
3419+
__le16 u2_mel = udev->bos->ss_cap->bU2DevExitLat;
3420+
3421+
/* If the device says it doesn't have *any* exit latency to come out of
3422+
* U1 or U2, it's probably lying. Assume it doesn't implement that link
3423+
* state.
3424+
*/
3425+
if ((state == USB3_LPM_U1 && u1_mel == 0) ||
3426+
(state == USB3_LPM_U2 && u2_mel == 0))
3427+
return;
34183428

34193429
/* We allow the host controller to set the U1/U2 timeout internally
34203430
* first, so that it can change its schedule to account for the

0 commit comments

Comments
 (0)