linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Wesley Cheng <quic_wcheng@quicinc.com>,
	"balbi@kernel.org" <balbi@kernel.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"quic_jackp@quicinc.com" <quic_jackp@quicinc.com>
Subject: Re: [PATCH] usb: dwc3: gadget: Wait for ep0 xfers to complete during dequeue
Date: Wed, 9 Mar 2022 20:11:04 +0000	[thread overview]
Message-ID: <c89bb8a7-e239-66d2-d94e-e0a2120469af@synopsys.com> (raw)
In-Reply-To: <319353ca-fe5d-81c8-029b-c4eebbee1959@synopsys.com>

Thinh Nguyen wrote:
> Hi,
> 
> Wesley Cheng wrote:
>> From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
>>
>> If the request being dequeued is currently active, then the current
>> logic is to issue a stop transfer command, and allow the command
>> completion to cleanup the cancelled list.  The DWC3 controller will
>> run into an end transfer command timeout if there is an ongoing EP0
>> transaction.  If this is the case, wait for the EP0 completion event
>> before proceeding to retry the endxfer command again.
> 
> Can you fix the commit message as follow:
> 
> If a Setup packet is received but yet to DMA out, the controller will
> not process the End Transfer command of any endpoint. Polling of its
> DEPCMD.CmdAct may block setting up TRB for Setup packet, causing a
> command timeout.
> 
> This may occur if the driver doesn’t service the completion interrupt of
> the control status stage yet due to system latency, then it won’t
> prepare TRB and start the transfer for the next Setup Stage. To the host
> side, the control transfer had completed, and the host can send a new
> Setup packet at this point.
> 
> In the meanwhile, if the driver receives an async call to dequeue a
> request (triggering End Transfer) to any endpoint, then the driver will
> service that End transfer first, blocking the control status stage
> completion handler. Since no TRB is available for the Setup stage, the
> Setup packet can’t be DMA’ed out and the End Transfer gets hung.
> 
> The driver must not block setting up of the Setup stage. So track and
> only issue the End Transfer command only when there’s Setup TRB prepared
> so that the controller can DMA out the Setup packet. Delay the End
> transfer command until there's no Setup TRB available. This is

typo:
Delay the End transfer command *if* there's no Setup TRB available.


> applicable to all DWC_usb3x IPs.
> 


  reply	other threads:[~2022-03-09 20:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09  0:41 [PATCH] usb: dwc3: gadget: Wait for ep0 xfers to complete during dequeue Wesley Cheng
2022-03-09 10:21 ` Greg KH
2022-03-09 19:01   ` Wesley Cheng
2022-03-09 20:03 ` Thinh Nguyen
2022-03-09 20:11   ` Thinh Nguyen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-03-09  0:37 Wesley Cheng

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=c89bb8a7-e239-66d2-d94e-e0a2120469af@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=quic_jackp@quicinc.com \
    --cc=quic_wcheng@quicinc.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 NNTP newsgroup(s).