Commit 00ad34cb authored by Mathias Nyman's avatar Mathias Nyman Committed by Wen Zhiwei
Browse files

xhci: Mitigate failed set dequeue pointer commands

stable inclusion
from stable-v6.6.58
commit 53cd1bb1f8ebf961a7be197734465893a8930a58
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IB3BSC

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=53cd1bb1f8ebf961a7be197734465893a8930a58



--------------------------------

commit fe49df60cdb7c2975aa743dc295f8786e4b7db10 upstream.

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: 4db35692 ("xhci: turn cancelled td cleanup to its own function")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20241016140000.783905-3-mathias.nyman@linux.intel.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarWen Zhiwei <wenzhiwei@kylinos.cn>
parent e31b65b8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1046,7 +1046,7 @@ static int xhci_invalidate_cancelled_tds(struct xhci_virt_ep *ep)
					td_to_noop(xhci, ring, cached_td, false);
					cached_td->cancel_status = TD_CLEARED;
				}

				td_to_noop(xhci, ring, td, false);
				td->cancel_status = TD_CLEARING_CACHE;
				cached_td = td;
				break;