linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] usb: xhci: improve Set TR Deq completion error handling
@ 2025-08-18 12:57 Niklas Neronin
  2025-08-18 12:57 ` [PATCH 1/4] usb: xhci: handle Set TR Deq TRB Error Niklas Neronin
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Niklas Neronin @ 2025-08-18 12:57 UTC (permalink / raw)
  To: mathias.nyman; +Cc: michal.pecio, linux-usb, Niklas Neronin

The Set TR Deq command instructs the hardware to skip Transfer Descriptors
(TDs) from A to B. Once the hardware processes the Set TR Deq command,
it returns a completion event indicating either success or an error.

In the event of success, TDs A to B are released, the dequeue pointer is
updated, and if there are still cancelled TDs, a new Set TR Deq command
is issued. Conversely, if an error occurs, a warning is logged, and TDs A
to B are released. This can lead to a mismatch between the driver
and hardware, eventually resulting in an critical error.

When feasible, attempt to resolve errors. Otherwise, retain unresolved
errors as they are and improve the warning message.

xHCI driver issues Set TR Deq commands in 4 places:
xhci_handle_cmd_stop_ep()
  After a successful Stop Endpoint completion event is received.

xhci_handle_cmd_set_deq()
  After receiving a Set TR Deq completion event and there are new
  cancelled TDs.

xhci_handle_cmd_reset_ep()
  After a Endpoint reset completion, Endpoint state is Stopped.

xhci_urb_dequeue()
  If clearing Endpoints Transaction Translator, Endpoint state is Stopped.

Niklas Neronin (4):
  usb: xhci: handle Set TR Deq TRB Error
  usb: xhci: handle Set TR Deq Slot Not Enabled Error
  usb: xhci: handle Set TR Deq Context State Error due to Slot state
  usb: xhci: handle Set TR Deq Context State Error due to Endpoint state

 drivers/usb/host/xhci-ring.c | 68 ++++++++++++++++++++++++++++--------
 1 file changed, 54 insertions(+), 14 deletions(-)

-- 
2.50.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-09-01  6:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18 12:57 [PATCH 0/4] usb: xhci: improve Set TR Deq completion error handling Niklas Neronin
2025-08-18 12:57 ` [PATCH 1/4] usb: xhci: handle Set TR Deq TRB Error Niklas Neronin
2025-08-21  9:32   ` Michał Pecio
2025-08-22 11:00     ` Neronin, Niklas
2025-08-18 12:57 ` [PATCH 2/4] usb: xhci: handle Set TR Deq Slot Not Enabled Error Niklas Neronin
2025-08-21 10:35   ` Michał Pecio
2025-08-22  7:22     ` Michał Pecio
2025-08-18 12:57 ` [PATCH 3/4] usb: xhci: handle Set TR Deq Context State Error due to Slot state Niklas Neronin
2025-08-22  7:49   ` Michał Pecio
2025-08-18 12:57 ` [PATCH 4/4] usb: xhci: handle Set TR Deq Context State Error due to Endpoint state Niklas Neronin
2025-08-22  8:15   ` Michał Pecio
2025-08-25  7:15     ` Michał Pecio
2025-08-27 11:53       ` Neronin, Niklas
2025-08-29  8:06         ` Michał Pecio
2025-08-29  8:14           ` Michał Pecio
2025-09-01  6:18           ` Michał Pecio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).