Hi, This is the patchset for xHCI USB2 hardware LPM. It basically includes 4 parts: 1. Check the host's USB2 LPM capability. 2. Check the device's LPM capability by getting its BOS descriptor. 3. When a LPM-capable device is enabled and addressed, do a LPM test to see if it can enter and resume from L1 successfully. 4. If the device pass the software LPM test, enable hardware LPM for it if host support hardware LPM. Patch1 - usbcore: get BOS descriptor set has been submitted before, but the bcdUSB field check part needs to be modified, so I submit it again. I've tested USB2 software and hardware LPM on xHCI 1.0 host and it seems work fine. The host successfully suspend and resume the device, and put it into U2 automatically if hardware LPM enabled. Unfortunately, there are devices which claim to be LPM-capable but fail the LPM test (they fail the USB-IF CV LPM test on Windows too so I assume driver is not the culprit), and after the test they may not work normally. In this case, usbcore will disconnect it and enumerate again. Add the devices to a lpm_failed_devs list so we'll not do LPM test to them again. Andiry Xu (8): usbcore: get BOS descriptor set usbcore: check device's LPM capability xHCI: refactor xhci_set_link_state xHCI: refactor xhci_test_and_clear_bit xHCI: Check host USB2 LPM capability xHCI: calculate HIRD xHCI: test USB2 software LPM xHCI: set USB2 hardware LPM drivers/usb/core/config.c | 103 +++++++++++++++++++++++ drivers/usb/core/hub.c | 9 ++ drivers/usb/core/usb.c | 1 + drivers/usb/core/usb.h | 2 + drivers/usb/host/xhci-ext-caps.h | 6 ++ drivers/usb/host/xhci-hub.c | 102 +++++++++++------------ drivers/usb/host/xhci-mem.c | 44 ++++++++++ drivers/usb/host/xhci-pci.c | 4 + drivers/usb/host/xhci-ring.c | 18 +++-- drivers/usb/host/xhci.c | 166 ++++++++++++++++++++++++++++++++++++++ drivers/usb/host/xhci.h | 29 +++++++- include/linux/usb.h | 14 +++ 12 files changed, 437 insertions(+), 61 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html