From: "Michał Pecio" <michal.pecio@gmail.com>
To: "Neronin, Niklas" <niklas.neronin@linux.intel.com>
Cc: mathias.nyman@linux.intel.com, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org
Subject: Re: [PATCH 10/12] usb: xhci: adjust empty TD list handling in handle_tx_event()
Date: Mon, 9 Sep 2024 10:22:08 +0200 [thread overview]
Message-ID: <20240909102208.490eb0ed@foxbook> (raw)
In-Reply-To: <1ae67893-fc97-4210-9e5d-74af158d5422@linux.intel.com>
Hi,
> > This used to get the empty list warning, but now it's mere
> > xhci_dbg(). Throwing out all queued TDs is not the common case and
> > it may easily be a bug. Indeed, I can readily name two cases when
> > it is a bug today:
> >
> > 1. Force Stopped Event on a NOP or Link following the missed TD.
> > Then trb_in_td() doesn't match subsequent TD and the rest is
> > trashed.
> >
> > Actually, this is a v6.11 regression since d56b0b2ab1429. Although
> > past behavior was bad and broken too, it was broken differently.
> >
> > 2. Ring Underrun/Overrun if new TDs were queued before we handled
> > it. If ep_trb_dma is NULL, nothing ever matches and everything goes
> > out.
> >
> > Arguably, these are rare events and I haven't observed them yet.
> > And one more problem that I don't think currently exists, but:
> >
> > 3. If you ever find yourself doing it on an ordinary event (Success,
> > Transaction Error, Babble, etc.) then, seriously, WTF?
> >
> > Bottom line, empty list is a very suspicious thing to see here. I
> > can only think of two legitimate cases:
> >
> > 1. Ring X-run, only if nothing new was queued since it occurred.
> > 2. FSE outside transfer TDs, if no transfer TDs existed after it.
>
> I can change it from a debug to a warning. Then the edge case should
> be more visible.
Actually, I'm no longer sure. If that ever happens, the user will next
see "WARN list empty" or "ERROR TRB not part of current TD" and this
will show there is a problem, so dyndbg will be enabled to investigate.
I would still like to see more comp_codes printed in those messages,
because on isoc there are some "weird" codes like Missed Service or
Underrun, which have a very different meaning from the usual ones and
are a source of bugs. But I would have to think about which cases it
is useful for, particularly after this change.
Lastly, I'm not sure if this change is worthwile. Over the weekend,
I have produced a fairly simple but dramatic simplification of this
whole code. The 'empty list' branch that your patch deals with can
be completely removed, because it duplicates functionality of other
code. The skipping loop is reduced down to 8 lines of code, as it
should have always been in the first place.
I will try to clean those patches up and send them out today. They
received varying degree of testing (some are two weeks old) and have
not caused any regression so far. They are simple and revieable IMO.
Regards,
Michal
next prev parent reply other threads:[~2024-09-09 8:22 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-05 14:32 [PATCH 00/12] xhci features for usb-next Mathias Nyman
2024-09-05 14:32 ` [PATCH 01/12] xhci: dbc: Fix STALL transfer event handling Mathias Nyman
2024-09-05 14:32 ` [PATCH 02/12] xhci: dbc: add dbgtty request to end of list once it completes Mathias Nyman
2024-09-05 14:32 ` [PATCH 03/12] xhci: Remove unused function declarations Mathias Nyman
2024-09-05 14:32 ` [PATCH 04/12] usb: xhci: remove excessive isoc frame debug message spam Mathias Nyman
2024-09-05 21:30 ` Thinh Nguyen
2024-09-06 13:27 ` Mathias Nyman
2024-09-07 0:41 ` Thinh Nguyen
2024-09-05 14:32 ` [PATCH 05/12] usb: xhci: remove excessive Bulk short packet debug message Mathias Nyman
2024-09-05 14:32 ` [PATCH 06/12] usb: xhci: remove unused variables from struct 'xhci_hcd' Mathias Nyman
2024-09-05 14:32 ` [PATCH 07/12] usb: xhci: make 'sbrn' a local variable Mathias Nyman
2024-09-05 14:32 ` [PATCH 08/12] usb: xhci: add comments explaining specific interrupt behaviour Mathias Nyman
2024-09-05 14:32 ` [PATCH 09/12] usb: xhci: remove 'retval' from xhci_pci_resume() Mathias Nyman
2024-09-05 14:32 ` [PATCH 10/12] usb: xhci: adjust empty TD list handling in handle_tx_event() Mathias Nyman
2024-09-06 4:44 ` fps
2024-09-06 7:09 ` Neronin, Niklas
2024-09-06 12:23 ` Michał Pecio
2024-09-06 13:05 ` Neronin, Niklas
2024-09-09 8:22 ` Michał Pecio [this message]
2024-09-05 14:32 ` [PATCH 11/12] xhci: Set quirky xHC PCI hosts to D3 _after_ stopping and freeing them Mathias Nyman
2024-09-05 14:33 ` [PATCH 12/12] xhci: support setting interrupt moderation IMOD for secondary interrupters 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=20240909102208.490eb0ed@foxbook \
--to=michal.pecio@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@linux.intel.com \
--cc=niklas.neronin@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