Re: [PATCH] xhci: handle isoc Babble and Buffer Overrun events properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 23.1.2024 11.10, Michal Pecio wrote:
xHCI 4.9 explicitly forbids assuming that the xHC has released its
ownership of a multi-TRB TD when it reports an error on one of the
early TRBs. Yet the driver makes such assumption and releases the TD,
allowing the remaining TRBs to be freed or overwritten by new TDs.

The xHC should also report completion of the final TRB due to its IOC
flag being set by us, regardless of prior errors. This event cannot
be recognized if the TD has already been freed earlier, resulting in
"Transfer event TRB DMA ptr not part of current TD" error message.

Fix this by reusing the logic for processing isoc Transaction Errors.
This also handles hosts which fail to report the final completion.

Fix transfer length reporting on Babble errors. They may be caused by
device malfunction, no guarantee that the buffer has been filled.

Signed-off-by: Michal Pecio <michal.pecio@xxxxxxxxx>

Thanks, adding to queue.

---

Question:

Will this become a game of whack-a-mole as new cases are reported?

Would it make sense to apply error_mid_td right away to more codes
that plausibly lead to an abort of the current TD?

Or do it after the initial patches prove themselves in real world?

I'd send tested patches that solve real world issues first to the usb-linus
(6.8 kernel), with stable tags.

Then sort out if we need to add error_mid_td to other completion codes,
and send patches for those to usb-next (6.9 kernel)

-Mathias




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux