xhci: handle stop endpoint command completion with endpoint in running state.
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 29 Jan 2021 13:00:40 +0000 (15:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Jan 2021 13:16:51 +0000 (14:16 +0100)
commit1174d44906d517ddb4f98bbe58a44d4554d0ef90
tree09cc9be07e5e24e4b5cefb4b8c595826a0b42deb
parent9ebf300078584bec2309464fbb249be62b339a2a
xhci: handle stop endpoint command completion with endpoint in running state.

Handle race where a stop endpoint command fails with "context state error"
as hardware hasn't actually started the ring yet after a previous urb
cancellation completed and restarted the endpoint.
Flushing the doorbell write that restart the endpoint reduced these cases,
but didn't completely resolve them.

Check if the ring is running in the stop endpoint completion handler, and
issue a new stop endpoint command in this case.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20210129130044.206855-24-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-ring.c