On Fri, 28 Feb 2025 18:11:46 +0100, Michał Pecio wrote:
What are your thoughts about killing error_mid_td completely and using a similar mechanism to deal with those final events?
The events would be taken care of.
It should be OK wrt DMA, because the HC has no reason to touch data
buffers after an error. Short Packet is done this way and it works.
- A remaining problem is that dequeue is advanced to end_trb too soon
and "tail" of the TD could be overwritten. Already a problem with Short Packet and I think it can be solved by replacing most xhci_dequeue_td() calls with xhci_td_cleanup() and adding to handle_tx_event():
ep_ring->dequeue = ep_trb; ep_ring->deq_seg = ep_seg;
Forgot to add:
4. Guaranteed low latency of error reporting.
5. Some annoying code for giving back 'error_mid_td' URBs under weird corner cases that I recently spent a few hours writing could be thrown out and handle_tx_event() would become a little simpler.