* [1/2] usb: gadget: Add start_frame to usb_request
@ 2018-11-08 2:24 Thinh Nguyen
0 siblings, 0 replies; 5+ messages in thread
From: Thinh Nguyen @ 2018-11-08 2:24 UTC (permalink / raw)
To: Felipe Balbi, Greg Kroah-Hartman, linux-usb; +Cc: Thinh Nguyen
Similar to URB's start_frame, add a field start_frame to the usb_request
to report the scheduled (micro)frame number of an isochronous transfer.
This option is useful for debugging purposes.
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
---
include/linux/usb/gadget.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index e5cd84a0f84a..ed9dbbce55ee 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -50,6 +50,7 @@ struct usb_ep;
* @short_not_ok: When reading data, makes short packets be
* treated as errors (queue stops advancing till cleanup).
* @dma_mapped: Indicates if request has been mapped to DMA (internal)
+ * @start_frame: the reported (micro)frame of the scheduled isoc transfer
* @complete: Function called when request completes, so this request and
* its buffer may be re-used. The function will always be called with
* interrupts disabled, and it must not sleep.
@@ -107,6 +108,8 @@ struct usb_request {
unsigned short_not_ok:1;
unsigned dma_mapped:1;
+ int start_frame; /* ISO ONLY */
+
void (*complete)(struct usb_ep *ep,
struct usb_request *req);
void *context;
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [1/2] usb: gadget: Add start_frame to usb_request
@ 2018-11-15 7:41 Felipe Balbi
0 siblings, 0 replies; 5+ messages in thread
From: Felipe Balbi @ 2018-11-15 7:41 UTC (permalink / raw)
To: Thinh Nguyen
Hi,
Thinh Nguyen <thinh.nguyen@synopsys.com> writes:
> Hi Felipe,
>
> On 11/7/2018 11:03 PM, Felipe Balbi wrote:
>> Hi,
>>
>> Thinh Nguyen <thinh.nguyen@synopsys.com> writes:
>>> Similar to URB's start_frame, add a field start_frame to the usb_request
>>> to report the scheduled (micro)frame number of an isochronous transfer.
>>> This option is useful for debugging purposes.
>>>
>>> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
>>> ---
>>> include/linux/usb/gadget.h | 3 +++
>>> 1 file changed, 3 insertions(+)
>>>
>>> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
>>> index e5cd84a0f84a..ed9dbbce55ee 100644
>>> --- a/include/linux/usb/gadget.h
>>> +++ b/include/linux/usb/gadget.h
>>> @@ -50,6 +50,7 @@ struct usb_ep;
>>> * @short_not_ok: When reading data, makes short packets be
>>> * treated as errors (queue stops advancing till cleanup).
>>> * @dma_mapped: Indicates if request has been mapped to DMA (internal)
>>> + * @start_frame: the reported (micro)frame of the scheduled isoc transfer
>>> * @complete: Function called when request completes, so this request and
>>> * its buffer may be re-used. The function will always be called with
>>> * interrupts disabled, and it must not sleep.
>>> @@ -107,6 +108,8 @@ struct usb_request {
>>> unsigned short_not_ok:1;
>>> unsigned dma_mapped:1;
>>>
>>> + int start_frame; /* ISO ONLY */
>> this name is a bit misleading. I can see functions trying to use it to
>> request that a particular request start on a specific frame. Would
>> "started_frame" be a better name, perhaps?
>
> What do you think of changing this field name to "frame_number"? It's
> generic enough so that this field can potentially be updated in the
> future to be used as a starting frame in the future, for synchronization.
I don't mind, but remember changing semantics will mean auditing every
user of this :-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [1/2] usb: gadget: Add start_frame to usb_request
@ 2018-11-15 7:15 Thinh Nguyen
0 siblings, 0 replies; 5+ messages in thread
From: Thinh Nguyen @ 2018-11-15 7:15 UTC (permalink / raw)
To: Felipe Balbi, Thinh Nguyen, Greg Kroah-Hartman, linux-usb
Hi Felipe,
On 11/7/2018 11:03 PM, Felipe Balbi wrote:
> Hi,
>
> Thinh Nguyen <thinh.nguyen@synopsys.com> writes:
>> Similar to URB's start_frame, add a field start_frame to the usb_request
>> to report the scheduled (micro)frame number of an isochronous transfer.
>> This option is useful for debugging purposes.
>>
>> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
>> ---
>> include/linux/usb/gadget.h | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
>> index e5cd84a0f84a..ed9dbbce55ee 100644
>> --- a/include/linux/usb/gadget.h
>> +++ b/include/linux/usb/gadget.h
>> @@ -50,6 +50,7 @@ struct usb_ep;
>> * @short_not_ok: When reading data, makes short packets be
>> * treated as errors (queue stops advancing till cleanup).
>> * @dma_mapped: Indicates if request has been mapped to DMA (internal)
>> + * @start_frame: the reported (micro)frame of the scheduled isoc transfer
>> * @complete: Function called when request completes, so this request and
>> * its buffer may be re-used. The function will always be called with
>> * interrupts disabled, and it must not sleep.
>> @@ -107,6 +108,8 @@ struct usb_request {
>> unsigned short_not_ok:1;
>> unsigned dma_mapped:1;
>>
>> + int start_frame; /* ISO ONLY */
> this name is a bit misleading. I can see functions trying to use it to
> request that a particular request start on a specific frame. Would
> "started_frame" be a better name, perhaps?
What do you think of changing this field name to "frame_number"? It's
generic enough so that this field can potentially be updated in the
future to be used as a starting frame in the future, for synchronization.
Thinh
^ permalink raw reply [flat|nested] 5+ messages in thread
* [1/2] usb: gadget: Add start_frame to usb_request
@ 2018-11-08 19:38 Thinh Nguyen
0 siblings, 0 replies; 5+ messages in thread
From: Thinh Nguyen @ 2018-11-08 19:38 UTC (permalink / raw)
To: Felipe Balbi, Thinh Nguyen, Greg Kroah-Hartman, linux-usb
Hi,
On 11/7/2018 11:03 PM, Felipe Balbi wrote:
> Hi,
>
> Thinh Nguyen <thinh.nguyen@synopsys.com> writes:
>> Similar to URB's start_frame, add a field start_frame to the usb_request
>> to report the scheduled (micro)frame number of an isochronous transfer.
>> This option is useful for debugging purposes.
>>
>> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
>> ---
>> include/linux/usb/gadget.h | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
>> index e5cd84a0f84a..ed9dbbce55ee 100644
>> --- a/include/linux/usb/gadget.h
>> +++ b/include/linux/usb/gadget.h
>> @@ -50,6 +50,7 @@ struct usb_ep;
>> * @short_not_ok: When reading data, makes short packets be
>> * treated as errors (queue stops advancing till cleanup).
>> * @dma_mapped: Indicates if request has been mapped to DMA (internal)
>> + * @start_frame: the reported (micro)frame of the scheduled isoc transfer
>> * @complete: Function called when request completes, so this request and
>> * its buffer may be re-used. The function will always be called with
>> * interrupts disabled, and it must not sleep.
>> @@ -107,6 +108,8 @@ struct usb_request {
>> unsigned short_not_ok:1;
>> unsigned dma_mapped:1;
>>
>> + int start_frame; /* ISO ONLY */
> this name is a bit misleading. I can see functions trying to use it to
> request that a particular request start on a specific frame. Would
> "started_frame" be a better name, perhaps?
>
Sure. That's more accurate.
Thinh
^ permalink raw reply [flat|nested] 5+ messages in thread
* [1/2] usb: gadget: Add start_frame to usb_request
@ 2018-11-08 7:03 Felipe Balbi
0 siblings, 0 replies; 5+ messages in thread
From: Felipe Balbi @ 2018-11-08 7:03 UTC (permalink / raw)
To: Thinh Nguyen, Greg Kroah-Hartman, linux-usb
Hi,
Thinh Nguyen <thinh.nguyen@synopsys.com> writes:
> Similar to URB's start_frame, add a field start_frame to the usb_request
> to report the scheduled (micro)frame number of an isochronous transfer.
> This option is useful for debugging purposes.
>
> Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
> ---
> include/linux/usb/gadget.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
> index e5cd84a0f84a..ed9dbbce55ee 100644
> --- a/include/linux/usb/gadget.h
> +++ b/include/linux/usb/gadget.h
> @@ -50,6 +50,7 @@ struct usb_ep;
> * @short_not_ok: When reading data, makes short packets be
> * treated as errors (queue stops advancing till cleanup).
> * @dma_mapped: Indicates if request has been mapped to DMA (internal)
> + * @start_frame: the reported (micro)frame of the scheduled isoc transfer
> * @complete: Function called when request completes, so this request and
> * its buffer may be re-used. The function will always be called with
> * interrupts disabled, and it must not sleep.
> @@ -107,6 +108,8 @@ struct usb_request {
> unsigned short_not_ok:1;
> unsigned dma_mapped:1;
>
> + int start_frame; /* ISO ONLY */
this name is a bit misleading. I can see functions trying to use it to
request that a particular request start on a specific frame. Would
"started_frame" be a better name, perhaps?
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-11-15 7:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-08 2:24 [1/2] usb: gadget: Add start_frame to usb_request Thinh Nguyen
2018-11-08 7:03 Felipe Balbi
2018-11-08 19:38 Thinh Nguyen
2018-11-15 7:15 Thinh Nguyen
2018-11-15 7:41 Felipe Balbi
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.