From: Felipe Balbi <felipe.balbi@linux.intel.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>Thinh Nguyen
<Thinh.Nguyen@synopsys.com>,
Linux USB <linux-usb@vger.kernel.org>
Cc: John Youn <John.Youn@synopsys.com>
Subject: [RFT/PATCH,18/38] usb: dwc3: gadget: check for Missed Isoc from event status
Date: Thu, 12 Apr 2018 10:17:07 +0300 [thread overview]
Message-ID: <87d0z4lwr0.fsf@linux.intel.com> (raw)
Hi,
Thinh Nguyen <Thinh.Nguyen@synopsys.com> writes:
> Hi,
>
> On 4/11/2018 1:21 AM, Felipe Balbi wrote:
>>
>> Hi,
>>
>> Felipe Balbi <felipe.balbi@linux.intel.com> writes:
>>>>> Without XferNotReady, we won't have a reliable way to know the uFrame
>>>>> number. Read the Isochronous programming sequence from your databook.
>>>>
>>>> Right. We need XferNotReady to know when to start isoc transfer. But if
>>>> there are still queued requests, DWC3 can just wait to see if any of
>>>> them will succeed to continue with the transfer just as how DWC3 is
>>>> handling it now.
>>>
>>> That's not what the databook says though. And that's also not intention
>>> of how the code is written as of now either. The way the code is written
>>> is the following:
>>>
>>> queue() -> XferNotReady -> start_isoc() -> if (missed) do_nothing() ->
>>> queue() -> end_transfer.
>>>
>>> That's not really waiting for the queue to be consumed, it's just
>>> delaying end transfer until we get another queue(). IOW, it just
>>> *happens* to give the controller time to go through the list of started
>>> requests.
>>>
>>>> If we end and restart the transfer right away, then we may lose more
>>>> isoc data than necessary (due to isoc scheduling at least 4 uFrame
>>>> ahead of time). Is there something you see that doesn't work with the
>>>> current implementation?
>>>
>>> Not _really_, I'm just trying to make the code easier to read and, I
>>> think, I've achieved that. Now, if we need to delay end transfer in the
>>> case where we have more requests in the controller's queue, that's easy
>>> enough to implement:
>>>
>>> @@ -2371,7 +2371,8 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep,
>>> if (event->status & DEPEVT_STATUS_BUSERR)
>>> status = -ECONNRESET;
>>>
>>> - if (event->status & DEPEVT_STATUS_MISSED_ISOC) {
>>> + if (event->status & DEPEVT_STATUS_MISSED_ISOC &&
>>> + list_empty(&dep->started_list) {
>>> status = -EXDEV;
>
> Maybe we should return the -EXDEV status every time there's a missed isoc.
you mean like this?
@@ -2358,10 +2358,11 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep,
if (event->status & DEPEVT_STATUS_BUSERR)
status = -ECONNRESET;
- if (event->status & DEPEVT_STATUS_MISSED_ISOC &&
- list_empty(&dep->started_list)) {
+ if (event->status & DEPEVT_STATUS_MISSED_ISOC) {
status = -EXDEV;
- stop = true;
+
+ if (list_empty(&dep->started_list))
+ stop = true;
}
dwc3_gadget_ep_cleanup_completed_requests(dep, event, status);
>>> stop = true;
>>> }
>>>
>>> I'm not sure this is a good idea though. Once we miss an interval, don't
>>> we need to know the next frame when transfer needs to be scheduled?
>>>
>>> Meaning we would need XferNotReady to properly schedule the new
>>> transfer?
>>
>> thinking about this a little more. This extra list_empty() check is not
>> wrong at all :-) I've amended this series with the 3 patches below. I'll
>> resend the series once I've given more time for people to test. Patches
>> have been updated to the branch on kernel.org as well, btw.
>
> Great! :)
> Thanks for all the new updates. I'll test it out when I have a chance.
sure, thanks a lot.
next reply other threads:[~2018-04-12 7:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-12 7:17 Felipe Balbi [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-04-13 7:08 [RFT/PATCH,18/38] usb: dwc3: gadget: check for Missed Isoc from event status Felipe Balbi
2018-04-13 2:10 Thinh Nguyen
2018-04-12 2:54 Thinh Nguyen
2018-04-11 8:20 Felipe Balbi
2018-04-11 7:09 Felipe Balbi
2018-04-11 2:03 Thinh Nguyen
2018-04-10 7:35 Felipe Balbi
2018-04-10 0:24 Thinh Nguyen
2018-04-09 11:26 Felipe Balbi
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=87d0z4lwr0.fsf@linux.intel.com \
--to=felipe.balbi@linux.intel.com \
--cc=John.Youn@synopsys.com \
--cc=Thinh.Nguyen@synopsys.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).