• Shyam Sundar S K's avatar
    usb: xhci: Issue stop EP command only when the EP state is running · 28a2369f
    Shyam Sundar S K authored
    on AMD platforms with SNPS 3.1 USB controller if stop endpoint command is
    issued the controller does not respond, when the EP is not in running
    state. HW completes the command execution and reports
    "Context State Error" completion code. This is as per the spec. However
    HW on receiving the second command additionally marks EP to Flow control
    state in HW which is RTL bug. This bug causes the HW not to respond
    to any further doorbells that are rung by the driver. This makes the EP
    to not functional anymore and causes gross functional failures.
    
    As a workaround, not to hit this problem, it's better to check the EP state
    and issue a stop EP command only when the EP is in running state.
    
    As a sidenote, even with this patch there is still a possibility of
    triggering the RTL bug if the context state races with the stop endpoint
    command as described in xHCI spec 4.6.9
    
    [code simplification and reworded sidenote in commit message -Mathias]
    Signed-off-by: default avatarShyam Sundar S K <Shyam-sundar.S-k@amd.com>
    Signed-off-by: default avatarNehal Shah <Nehal-bakulchandra.Shah@amd.com>
    Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    28a2369f
xhci-hub.c 46.9 KB