Linux USB
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Michal Pecio <michal.pecio@gmail.com>, linux-usb@vger.kernel.org
Subject: Re: [PATCH] xhci: handle isoc Babble and Buffer Overrun events properly
Date: Tue, 23 Jan 2024 17:32:28 +0200	[thread overview]
Message-ID: <6f24aac1-b20c-ffee-89e6-71c23e0c075f@linux.intel.com> (raw)
In-Reply-To: <20240123101049.4f76f43f@foxbook>

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@gmail.com>

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

      reply	other threads:[~2024-01-23 15:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23  9:10 [PATCH] xhci: handle isoc Babble and Buffer Overrun events properly Michal Pecio
2024-01-23 15:32 ` Mathias Nyman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6f24aac1-b20c-ffee-89e6-71c23e0c075f@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=michal.pecio@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox