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: [v3,2/2] usb: dwc3: gadget: Report isoc transfer frame number
Date: Fri, 07 Dec 2018 08:01:01 +0200 [thread overview]
Message-ID: <87a7lhx4de.fsf@linux.intel.com> (raw)
Hi,
Thinh Nguyen <thinh.nguyen@synopsys.com> writes:
>>> diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
>>> index 679c12e14522..2de563124fc1 100644
>>> --- a/drivers/usb/dwc3/gadget.c
>>> +++ b/drivers/usb/dwc3/gadget.c
>>> @@ -2254,6 +2254,19 @@ static int dwc3_gadget_ep_reclaim_completed_trb(struct dwc3_ep *dep,
>>> if (chain && (trb->ctrl & DWC3_TRB_CTRL_HWO))
>>> trb->ctrl &= ~DWC3_TRB_CTRL_HWO;
>>>
>>> + /*
>>> + * For isochronous transfers, the first TRB in a service interval must
>>> + * have the Isoc-First type. Track and report its interval frame number.
>>> + */
>>> + if (usb_endpoint_xfer_isoc(dep->endpoint.desc) &&
>>> + (trb->ctrl & DWC3_TRBCTL_ISOCHRONOUS_FIRST)) {
>>> + unsigned int frame_number;
>>> +
>>> + frame_number = DWC3_TRB_CTRL_GET_SID_SOFN(trb->ctrl);
>>> + frame_number &= ~(dep->interval - 1);
>>> + req->request.frame_number = frame_number;
>>> + }
>> could you refresh my memory on how this is going to be used?
>>
>
> Sure. This informs the upper layer driver what interval the isoc request
> went out. The users can use this information for applications that
> require synchronization with the host.
Thanks. Do you have an example of a gadget that would use it? Perhaps
g_webcam can rely on this to improve its scheduling? I have this in my
testing/next already, just looking for an actual user :-)
next reply other threads:[~2018-12-07 6:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-07 6:01 Felipe Balbi [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-12-08 1:21 [v3,2/2] usb: dwc3: gadget: Report isoc transfer frame number Thinh Nguyen
2018-12-06 3:48 Thinh Nguyen
2018-12-05 9:15 Felipe Balbi
2018-11-16 3:03 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=87a7lhx4de.fsf@linux.intel.com \
--to=balbi@kernel.org \
--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).