mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wesley Cheng <quic_wcheng@quicinc.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"quic_jackp@quicinc.com" <quic_jackp@quicinc.com>
Subject: Re: [PATCH v4] usb: dwc3: gadget: Add 1ms delay after end transfer command without IOC
Date: Fri, 3 Mar 2023 11:35:47 -0800	[thread overview]
Message-ID: <e1fd0c4b-037e-6112-7698-dd46307246e4@quicinc.com> (raw)
In-Reply-To: <20230301224445.4gmkrhw467lopstg@synopsys.com>

Hi Thinh,

On 3/1/2023 2:44 PM, Thinh Nguyen wrote:
> On Tue, Feb 28, 2023, Wesley Cheng wrote:
>> Previously, there was a 100uS delay inserted after issuing an end transfer
>> command for specific controller revisions.  This was due to the fact that
>> there was a GUCTL2 bit field which enabled synchronous completion of the
>> end transfer command once the CMDACT bit was cleared in the DEPCMD
>> register.  Since this bit does not exist for all controller revisions, add
> 
> Can we also note here that we rely on End Transfer command completion
> interrupt on newer versions.
> 
>> the delay back in, and increase the duration to 1ms for the controller to
>> complete the command.
>>
>> An issue was seen where the USB request buffer was unmapped while the DWC3
>> controller was still accessing the TRB.  However, it was confirmed that the
>> end transfer command was successfully submitted. (no end transfer timeout)
>> In situations, such as dwc3_gadget_soft_disconnect() and
>> __dwc3_gadget_ep_disable(), the dwc3_remove_request() is utilized, which
>> will issue the end transfer command, and follow up with
>> dwc3_gadget_giveback().  At least for the USB ep disable path, it is
>> required for any pending and started requests to be completed and returned
>> to the function driver in the same context of the disable call.  Without
>> the GUCTL2 bit, it is not ensured that the end transfer is completed before
>> the buffers are unmapped.
>>
> 
> I think this also needs a Fixes tag.
> 
> Everything else looks good to me.
> 

Thanks for the reviews, Thinh.  Will fix the above and resubmit.

Thanks
Wesley Cheng

      reply	other threads:[~2023-03-03 19:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-01  3:32 Wesley Cheng
2023-03-01 22:44 ` Thinh Nguyen
2023-03-03 19:35   ` Wesley Cheng [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=e1fd0c4b-037e-6112-7698-dd46307246e4@quicinc.com \
    --to=quic_wcheng@quicinc.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=quic_jackp@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

all inboxes | Powered by JetHome®