linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@kernel.org>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb\@vger.kernel.org" <linux-usb@vger.kernel.org>
Cc: John Youn <John.Youn@synopsys.com>
Subject: Re: [PATCH] usb: dwc3: gadget: Remove incomplete check
Date: Sun, 29 Mar 2020 11:03:52 +0300	[thread overview]
Message-ID: <87v9mn37vb.fsf@kernel.org> (raw)
In-Reply-To: <9a2504a3-6a89-39f2-3a9c-9ee933903d8e@synopsys.com>

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


Hi,

Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes:
>> One thing I don't get from your patch is why you're completely removing
>> the function and why isn't req->direction and actual == length not
>> needed anymore. Could you explain?
>
> It's because there's no use for that function outside of checking for 
> number of pending SGs and resume.

wait, huh? What about cases when user unplugs cable midtransfer? We have
versions of dwc3 HW which fail to produce disconnect interrupt, right?

>> @@ -2491,6 +2492,16 @@ static bool dwc3_gadget_ep_request_completed(struct dwc3_request *req)
>>   	if (!req->direction)
>>   		return true;
>>   
>> +	/*
>> +	 * If there are pending scatterlist entries, we should
>> +	 * continue processing them.
>> +	 */
>> +	if (req->num_pending_sgs)
>> +		return false;
>> +
>> +	if (usb_endpoint_xfer_isoc(dep->endpoint.desc))
>> +		do_something();
>
> do_something() will always return true here.

Will do "do_something", then return true or simply return true?

>>   	return req->request.actual == req->request.length;
>
> This should always be true if the request completes. By spec, bulk and 
> interrupt endpoints data delivery are guaranteed, and the retry/error 
> detection is done at the lower level.  If by chance that the host fails 
> to request for data multiple times at the packet level, it will issue a 
> ClearFeature(halt_ep) request to the endpoint. This will trigger dwc3 to 
> stop the endpoint and cancel the transfer, and we still won't resume 
> this transfer.

we can unplug the cable at any time, even mid-transfer.

-- 
balbi

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

  reply	other threads:[~2020-03-29  8:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06  3:44 [PATCH] usb: dwc3: gadget: Remove incomplete check Thinh Nguyen
2020-03-15  9:19 ` Felipe Balbi
2020-03-16  0:33   ` Thinh Nguyen
2020-03-16  7:00     ` Felipe Balbi
2020-03-16 20:37       ` Thinh Nguyen
2020-03-29  8:03         ` Felipe Balbi [this message]
2020-03-29 23:44           ` Thinh Nguyen
2020-03-30  8:26             ` Felipe Balbi
2020-03-30 19:30               ` Thinh Nguyen
2020-03-30 21:34                 ` Felipe Balbi
2020-03-31  1:47                   ` Thinh Nguyen
2020-03-31  8:12                     ` Felipe Balbi
2020-03-31  8:39                       ` 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=87v9mn37vb.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 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).