• Sarah Sharp's avatar
    usb: Disable USB 2.0 Link PM before device reset. · 9e5f97bb
    Sarah Sharp authored
    commit dcc01c08 upstream.
    
    Before the USB core resets a device, we need to disable the L1 timeout
    for the roothub, if USB 2.0 Link PM is enabled.  Otherwise the port may
    transition into L1 in between descriptor fetches, before we know if the
    USB device descriptors changed.  LPM will be re-enabled after the
    full device descriptors are fetched, and we can confirm the device still
    supports USB 2.0 LPM after the reset.
    
    We don't need to wait for the USB device to exit L1 before resetting the
    device, since the xHCI roothub port diagrams show a transition to the
    Reset state from any of the Ux states (see Figure 34 in the 2012-08-14
    xHCI specification update).
    
    This patch should be backported to kernels as old as 3.2, that contain
    the commit 65580b43 "xHCI: set USB2
    hardware LPM".  That was the first commit to enable USB 2.0
    hardware-driven Link Power Management.
    Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
    [bwh: Backported to 3.2: adjust context]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    Cc: Yang Yingliang <yangyingliang@huawei.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    9e5f97bb
hub.c 123 KB