• Sarah Sharp's avatar
    USB: xhci: Set EP0 dequeue ptr after reset of configured device. · 2d1ee590
    Sarah Sharp authored
    When a configured device is reset, the control endpoint's ring is reused.
    If control transfers to the device were issued before the device is reset,
    the dequeue pointer will be somewhere in the middle of the ring.  If the
    device is then issued an address with the set address command, the xHCI
    driver must provide a valid input context for control endpoint zero.
    
    The original code would give the hardware the original input context,
    which had a dequeue pointer set to the top of the ring.  This would cause
    the host to re-execute any control transfers until it reached the ring's
    enqueue pointer.  When issuing a set address command for a device that has
    just been configured and then reset, use the control endpoint's enqueue
    pointer as the hardware's dequeue pointer.
    
    Assumption:  All control transfers will be completed or cancelled before
    the set address command is issued to the device.  If there are any
    outstanding control transfers, this code will not work.
    Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    2d1ee590
xhci.c 73.3 KB