public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Udipto Goswami <quic_ugoswami@quicinc.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	Jack Pham <quic_jackp@quicinc.com>,
	Pratham Pratap <quic_ppratap@quicinc.com>,
	Wesley Cheng <quic_wcheng@quicinc.com>
Subject: Re: [PATCH] usb: dwc3: ep0: Add implementation of ep0_dequeue separately
Date: Tue, 22 Nov 2022 01:30:38 +0000	[thread overview]
Message-ID: <20221122013033.if667zpm2p47he6r@synopsys.com> (raw)
In-Reply-To: <93e1a840-6d9f-9a6a-d848-d006f1333d18@quicinc.com>

Hi Udipto,

On Fri, Nov 18, 2022, Udipto Goswami wrote:
> Hi Thinh
> 
> On 11/18/22 7:31 AM, Thinh Nguyen wrote:
> > On Thu, Nov 17, 2022, Udipto Goswami wrote:
> > > A dequeue for ep0 need to adjust the handling based on the
> > > data stage and status stage. Currently if ep0 is in data/status
> > > stage the handling isn't that different, driver will try giveback
> > > as part of dequeue process which might potentially lead to the
> > > controller accessing invalid trbs.
> > > 
> > > Also for ep0 the requests aren't moved into the started_list,
> > > which might potentially lead to the un-mapping of the request
> > > buffers without sending endxfer.
> > 
> > Maybe we need to track started_list for control endpoint? If the request
> > isn't prepared yet or that the transfer had completed, then there's no
> > need to issue End Tranfer command.
> > 
> > But I believe sending End Transfer for inactive endpoint should be fine
> > also. Then we maybe able to get away without checking the started list.
> > If you're planning to do that, please test and note it somewhere.
> > 
> > > 
> thanks for the suggestion, sure i'll do some more experiments and confirm
> it.
> 

Just curious, how do you hit/test this scenario?

For other endpoint types, I can see possible scenarios where a dequeue
may be needed, but I don't see one for control transfer.

The host can cancel the control transfer, and the controller will see
"setup_packet_pending" and handle accordingly. If there's a disconnect,
that's also handled separately by the controller driver also. So, where
does ep0_dequeue come into play here?

Thanks,
Thinh

  reply	other threads:[~2022-11-22  1:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17  5:49 [PATCH] usb: dwc3: ep0: Add implementation of ep0_dequeue separately Udipto Goswami
2022-11-18  2:01 ` Thinh Nguyen
2022-11-18  6:06   ` Udipto Goswami
2022-11-22  1:30     ` Thinh Nguyen [this message]
2022-11-22  9:48       ` Udipto Goswami
2022-11-23  2:06         ` Thinh Nguyen
2022-12-05  5:36           ` Udipto Goswami

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=20221122013033.if667zpm2p47he6r@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=quic_jackp@quicinc.com \
    --cc=quic_ppratap@quicinc.com \
    --cc=quic_ugoswami@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