All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@kernel.org>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org
Cc: John Youn <John.Youn@synopsys.com>
Subject: Re: [PATCH] usb: dwc3: gadget: Allow restarting a transfer
Date: Tue, 29 Sep 2020 09:35:06 +0300	[thread overview]
Message-ID: <87h7rh9jl1.fsf@kernel.org> (raw)
In-Reply-To: <d2664c6b9cbaa091c1ce7bea25e02989fc7f6272.1601342393.git.Thinh.Nguyen@synopsys.com>

[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]

Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes:

> For streams, sometime host may reject a stream and the device may need
> to reinitiate that stream by stopping and restarting a transfer. In this
> case, all the TRBs may have already been prepared. Allow the
> __dwc3_gadget_kick_transfer() to go through to reinitiate the stream.
>
> Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
> ---
>  drivers/usb/dwc3/gadget.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
> index 82bc075ba97c..c53a22f0d952 100644
> --- a/drivers/usb/dwc3/gadget.c
> +++ b/drivers/usb/dwc3/gadget.c
> @@ -1327,7 +1327,7 @@ static int __dwc3_gadget_kick_transfer(struct dwc3_ep *dep)
>  	u32				cmd;
>  
>  	ret = dwc3_prepare_trbs(dep);
> -	if (ret <= 0)
> +	if (ret < 0)

do you mind adding a comment here stating the detail about ret == 0 and
why we're still continuing with it? This would prevent someone from
reverting this change years down the line.

Thanks

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]

  reply	other threads:[~2020-09-29  6:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29  1:24 [PATCH] usb: dwc3: gadget: Allow restarting a transfer Thinh Nguyen
2020-09-29  6:35 ` Felipe Balbi [this message]
2020-09-29  7:19   ` Thinh Nguyen

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=87h7rh9jl1.fsf@kernel.org \
    --to=balbi@kernel.org \
    --cc=John.Youn@synopsys.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.