]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xhci: Avoid queuing redundant Stop Endpoint command for stalled endpoint
authorMathias Nyman <mathias.nyman@linux.intel.com>
Tue, 11 Mar 2025 15:45:49 +0000 (17:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Mar 2025 16:58:43 +0000 (17:58 +0100)
commit0c74d232578b1a7071e0312312811cb75b26b202
tree5218524c1480c42e70007957f4bb16999d35bdbd
parent525b139fb4033a9ba5abd6ca3f6a6baa3b2fe3d4
xhci: Avoid queuing redundant Stop Endpoint command for stalled endpoint

If EP_STALLED flag is set in xhci_urb_dequeue(), without EP_HALTED or
SET_DEQ_PENDING flags, then the endpoint is in stopped state and the
cancelled URB can be given back immediately withouth queueing
a 'stop endpoint' command.

Without this change the cancelled URB would eventually be given back
in the 'context state error' completion path of the 'stop endpoint'
command. This is not optimal.

For this improvement to work the EP_STALLED flag must be cleared with
xhci lock held.

Suggested-by: Michal Pecio <michal.pecio@gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20250311154551.4035726-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c