1

xhci: Mitigate failed set dequeue pointer commands

Avoid xHC host from processing a cancelled URB by always turning
cancelled URB TDs into no-op TRBs before queuing a 'Set TR Deq' command.

If the command fails then xHC will start processing the cancelled TD
instead of skipping it once endpoint is restarted, causing issues like
Babble error.

This is not a complete solution as a failed 'Set TR Deq' command does not
guarantee xHC TRB caches are cleared.

Fixes: 4db356924a ("xhci: turn cancelled td cleanup to its own function")
Cc: stable@vger.kernel.org
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20241016140000.783905-3-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Mathias Nyman 2024-10-16 16:59:58 +03:00 committed by Greg Kroah-Hartman
parent 6599b6a6fa
commit fe49df60cd

View File

@ -1023,7 +1023,7 @@ static int xhci_invalidate_cancelled_tds(struct xhci_virt_ep *ep)
td_to_noop(xhci, ring, cached_td, false); td_to_noop(xhci, ring, cached_td, false);
cached_td->cancel_status = TD_CLEARED; cached_td->cancel_status = TD_CLEARED;
} }
td_to_noop(xhci, ring, td, false);
td->cancel_status = TD_CLEARING_CACHE; td->cancel_status = TD_CLEARING_CACHE;
cached_td = td; cached_td = td;
break; break;