devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejas Joglekar <Tejas.Joglekar@synopsys.com>
To: Jun Li <lijun.kernel@gmail.com>,
	Tejas Joglekar <Tejas.Joglekar@synopsys.com>
Cc: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux USB List <linux-usb@vger.kernel.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Mathias Nyman <mathias.nyman@intel.com>,
	John Youn <John.Youn@synopsys.com>, Li Jun <jun.li@nxp.com>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Subject: Re: [PATCH v3 0/4] Add logic to consolidate TRBs for Synopsys xHC
Date: Fri, 24 Jul 2020 00:15:45 +0000	[thread overview]
Message-ID: <3dec20c0-6fd3-ff40-091c-93cb093a2ff9@synopsys.com> (raw)
In-Reply-To: <CAKgpwJX6awJeqVsa_3mX_+UbhC+3ns=dLeiXBz7Na5QkQRZpjQ@mail.gmail.com>

Hello,
On 7/23/2020 4:05 PM, Jun Li wrote:
> Tejas Joglekar <Tejas.Joglekar@synopsys.com> 于2020年5月27日周三 下午7:54写道:
>>
>> The Synopsys xHC has an internal TRB cache of size TRB_CACHE_SIZE for
>> each endpoint. The default value for TRB_CACHE_SIZE is 16 for SS and 8
>> for HS. The controller loads and updates the TRB cache from the
>> transfer ring in system memory whenever the driver issues a start
>> transfer or update transfer command.
>>
>> For chained TRBs, the Synopsys xHC requires that the total amount of
>> bytes for all TRBs loaded in the TRB cache be greater than or equal to
>> 1 MPS. Or the chain ends within the TRB cache (with a last TRB).
>>
>> If this requirement is not met, the controller will not be able to
>> send or receive a packet and it will hang causing a driver timeout and
>> error.
> 
> Hi Tejas Joglekar
> 
> I am debugging  a similar issue on Synipsys XHC, it's not the same case
> but I am wondering if it also linked to this HW limitation.
> 
> My Synopsys XHC based host enable UAS, when enumerates a UAS
> HDD, one BULK-IN EP with stream enabled will not generate event for
> trb(with stream ID 1) after a 16/4096 bytes(with stream ID 2) finished in
> previous trb.
> 
> If I change the last OK urb/trb's buffer length from 4096 to 512, the issue
> will gone.
> 
> following is the sequence of the question EP-IN:
> 
> <idle>-0     [000] d.h1   154.961710: xhci_urb_giveback: ep3in-bulk:
> urb ffff0001775f6f00 pipe 3221324672 slot 1 length 36/36 sgs 1/1
> stream 1 flags 00040200
> <idle>-0     [000] d.h1   154.962023: xhci_urb_giveback: ep3in-bulk:
> urb ffff000177d00400 pipe 3221324672 slot 1 length 96/96 sgs 1/1
> stream 1 flags 00040200
> <idle>-0     [000] d.h1   154.970395: xhci_urb_giveback: ep3in-bulk:
> urb ffff000177d00400 pipe 3221324672 slot 1 length 11/255 sgs 1/1
> stream 1 flags 00040200
> <idle>-0     [000] d.h1   154.970562: xhci_urb_giveback: ep3in-bulk:
> urb ffff000177d00400 pipe 3221324672 slot 1 length 20/255 sgs 1/1
> stream 1 flags 00040200
> <idle>-0     [000] d.h1   154.970786: xhci_urb_giveback: ep3in-bulk:
> urb ffff000177d00400 pipe 3221324672 slot 1 length 60/255 sgs 1/1
> stream 1 flags 00040200
> <idle>-0     [000] d.h1   155.851600: xhci_urb_giveback: ep3in-bulk:
> urb ffff000177d00200 pipe 3221324672 slot 1 length 16/4096 sgs 1/1
> stream 2 flags 00040200
> 
> /* then the next ep3-in trb will not generate event and stopped, so
> driver timeout in the end */
> kworker/u8:2-349   [003] d..3   155.851987: xhci_urb_enqueue:
> ep3in-bulk: urb ffff000170492400 pipe 3221324672 slot 1 length 0/32
> sgs 1/1 stream 1 flags 00040200
> kworker/u8:2-349   [003] d..4   155.851989: xhci_queue_trb: STREAM:
> Buffer 00000000c19cf000 length 32 TD size 0 intr 0 type 'Normal' flags
> b:i:I:c:s:I:e:c
> kworker/u8:2-349   [003] d..4   155.851991: xhci_inc_enq: STREAM
> ffff000177f86f80: enq 0x00000000be0eb060(0x00000000be0eb000) deq
> 0x00000000be0eb050(0x00000000be0eb000) segs 2 stream 1 free_trbs 508
> bounce 1024 cycle 1
> 
> Do you have any ideas?
> 
From initial observation of your issue it seems to be unrelated with the
changes in my patch. But could you please provide, USB analyzer trace logs
for the working and non-working case? Also it would be helpful if you can
provide device details which you are testing.

> thanks
> Li Jun

Thanks & Regards,
 Tejas Joglekar


      reply	other threads:[~2020-07-24  0:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 10:40 [PATCH v3 0/4] Add logic to consolidate TRBs for Synopsys xHC Tejas Joglekar
2020-05-27 10:40 ` [PATCH v3 1/4] dt-bindings: usb: Add documentation for SG trb cache size quirk Tejas Joglekar
2020-05-29 18:05   ` Rob Herring
2020-06-08  4:32 ` [PATCH v3 0/4] Add logic to consolidate TRBs for Synopsys xHC Tejas Joglekar
2020-06-09  8:57   ` Mathias Nyman
2020-06-11 18:07     ` Tejas Joglekar
2020-06-30  6:28       ` Tejas Joglekar
     [not found] ` <83eba2e9f0069f20ccc94537e3b99cbaec209441.1590415123.git.joglekar@synopsys.com>
     [not found]   ` <5534d9d6-5452-dade-e46e-f4b0910becdb@synopsys.com>
     [not found]     ` <877dvhqh2e.fsf@kernel.org>
2020-07-15  5:51       ` [PATCH v3 3/4] usb: dwc3: Add device property sgl-trb-cache-size-quirk Tejas Joglekar
2020-07-21  9:47         ` Felipe Balbi
2020-07-21 16:57           ` Tejas Joglekar
2020-07-31 10:13             ` Tejas Joglekar
2020-08-04  0:44               ` Thinh Nguyen
2020-08-04  1:59                 ` Jun Li
2020-07-23 10:35 ` [PATCH v3 0/4] Add logic to consolidate TRBs for Synopsys xHC Jun Li
2020-07-24  0:15   ` Tejas Joglekar [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=3dec20c0-6fd3-ff40-091c-93cb093a2ff9@synopsys.com \
    --to=tejas.joglekar@synopsys.com \
    --cc=John.Youn@synopsys.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jun.li@nxp.com \
    --cc=lijun.kernel@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=robh+dt@kernel.org \
    /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 NNTP newsgroup(s).