public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michał Pecio" <michal.pecio@gmail.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: linux-usb@vger.kernel.org, Mathias Nyman <mathias.nyman@intel.com>
Subject: Re: "Transfer event TRB DMA ptr not part of current TD" spam after USB disconnection
Date: Mon, 15 Jan 2024 17:27:09 +0100	[thread overview]
Message-ID: <20240115172709.0b6f2bba@foxbook> (raw)
In-Reply-To: <a4573246-7047-dba3-efbf-3f88a952e322@linux.intel.com>

Thanks for looking at this.

I recognize that the situation is tricky and simply reverting
d104d0152a97f is not a permanent option if other hosts need it.

Yes, I have set up a test machine to debug this and I can use it to
try potential solutions. If you have your own NEC uPD720200 specimen
you could reproduce it yourself, all it takes is unplugging any UVC
isochronous camera while recording with any software. This driver
queues plenty of buffers, so chances of hitting a split TD are good.


Regarding the spec, section 4.10.2 only states that an error shall
generate _a_ Transfer Event on current TRB regargdless of its flags
and that an error may occur on any TRB of a TD.

I think more relevant and useful is the final note in section 4.9.1:

> If an error is detected while processing a multi-TRB TD, the xHC shall
> generate a Transfer Event for the TRB that the error was detected on
> with the appropriate error Condition Code, then may advance to the next
> TD. If in the process of advancing to the next TD, a Transfer TRB is
> encountered with its IOC flag set, then the Condition Code of the
> Transfer Event generated for that Transfer TRB should be Success,
> because there was no error actually associated with the TRB that
> generated the Event. However, an xHC implementation may redundantly 
> assert the original error Condition Code.

To me it looks like the host is expected to skip the remaining TRBs
(section 4.10.2 also mentions continuing to the next ESIT on isoch EPs),
but subsequent text seems to assume that IOC flags will nevertheless be
honored by the xHC (NEC fails here). It is noteworthy that the host is
encouraged to respond "success", so the driver must remember earlier
errors anyway while waiting till the end of the TD.


Regards,
Michal

  reply	other threads:[~2024-01-15 16:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12 22:52 "Transfer event TRB DMA ptr not part of current TD" spam after USB disconnection Michał Pecio
2024-01-13 20:47 ` Michał Pecio
2024-01-14 14:06   ` Michał Pecio
2024-01-15 13:58     ` Mathias Nyman
2024-01-15 16:27       ` Michał Pecio [this message]
2024-01-16 15:36         ` [RFT PATCH] xhci: process isoc TD properly when there was an error mid TD Mathias Nyman
2024-01-16 22:20           ` Michał Pecio
2024-01-17 10:46             ` Mathias Nyman
2024-01-17 17:49               ` Michał Pecio
2024-01-18 11:00                 ` Isochronous error handling bug on VIA VL805 Michał Pecio
2024-01-18 11:10                   ` Michał Pecio
2024-01-18 13:54                   ` Mathias Nyman
2024-01-18 13:56                     ` [RFT PATCH v2] xhci: process isoc TD properly when there was an error mid TD Mathias Nyman
2024-01-18 22:16                       ` Michał Pecio
2024-01-19 10:49                         ` Mathias Nyman
2024-01-19 10:58                           ` [RTF PATCH v3] " Mathias Nyman
2024-01-19 21:54                             ` Michał Pecio
2024-01-22  9:03                               ` Michał Pecio
2024-01-22 13:37                                 ` Mathias Nyman
2024-01-22 17:10                                   ` Michał Pecio
2024-01-22 11:47                               ` Mathias Nyman

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=20240115172709.0b6f2bba@foxbook \
    --to=michal.pecio@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=mathias.nyman@linux.intel.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