Linux-USB Archive mirror
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@intel.com>
To: app l <lipc198702@gmail.com>
Cc: gregkh@linuxfoundation.org, USB <linux-usb@vger.kernel.org>
Subject: Re: dwc3 hci_version==0x110 should configured xhci->quirks |= XHCI_LINK_TRB_QUIRK in xhci_init
Date: Tue, 14 May 2024 12:17:32 +0300	[thread overview]
Message-ID: <1a03a778-75db-9345-0baa-4031660e7192@intel.com> (raw)
In-Reply-To: <CAGaOi3bfswEqzF2jzoipzOwzyRknD1oxzwayM1r3KG0QYDrhdQ@mail.gmail.com>

Hi

On 13.5.2024 16.40, app l wrote:
> Hi,
>     Host mode,bulk in, dwc3,version; 0x110
>     A TD is comprised of two normal trbs. The TD length is 0x1000.

Is the bulk TD split into two trbs due to scatter gather data buffer, or
by xhci driver due to buffer alignment requirements?

Otherwise one TRB should be enough to point to 4k data

> There is a link trb between the two normal trbs. If the chain bit
> (bit4) in the
> link trb is 0, there are two interrupts and the data will be
> lost(scene 1). If the chain bit (bit4) in
> the link trb is 1, there is one interrupts and then the data is normal(scene 2).
> A TD is comprised of two normal trbs. There is one interrupts and then
> the data is normal(scene 3).
> So I think hci_version == 0x110,it should also be configured
> xhci->quirks |= XHCI_LINK_TRB_QUIRK in xhci_init;

The chain bit for the link trb should always be set by driver if the link is in
the middle of a TD. This is done in inc_enq() by checking if trb before Link trb
has chain bit set.

The XHCI_LINK_TRB_QUIRK is for controllers that always need Link trb chain bit set
even if no TD is spanning the segment. i.e. link trb chain bit is never cleared.

There might be some other issue here.

Any chance you could try to get a snapshot of the endpoint ring, and event ring
when this is seen.

debugfs example snippet of device 1, endpoint 2 transfer ring

# mount -t debugfs none /sys/kernel/debug/
# cat /sys/kernel/debug/usb/xhci/0000:00:14.0/devices/01/ep02/trbs
...
0 0x00000001041e0fc0: Buffer 00000001041e5000 length 13 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:c
0 0x00000001041e0fd0: Buffer 00000001041e5000 length 13 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:c
0 0x00000001041e0fe0: Buffer 00000001041e5000 length 13 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:c
0 0x00000001041e0ff0: LINK 00000001041e1000 intr 0 type 'Link' flags i:c:t:c
1 0x00000001041e1000: Buffer 00000001041e5000 length 13 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:c
1 0x00000001041e1010: Buffer 00000001041e5000 length 13 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:c
1 0x00000001041e1020: Buffer 00000001041e5000 length 13 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:c
...

Thanks
Mathias

           reply	other threads:[~2024-05-14  9:15 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CAGaOi3bfswEqzF2jzoipzOwzyRknD1oxzwayM1r3KG0QYDrhdQ@mail.gmail.com>]

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=1a03a778-75db-9345-0baa-4031660e7192@intel.com \
    --to=mathias.nyman@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lipc198702@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).