public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Michael Grzeschik <mgr@pengutronix.de>,
	Avichal Rakesh <arakesh@google.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Daniel Scally <dan.scally@ideasonboard.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jayant Chowdhary <jchowdhary@google.com>,
	"etalvala@google.com" <etalvala@google.com>,
	Michael Riesch <michael.riesch@wolfvision.net>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/3] usb: gadget: uvc: allocate requests based on frame interval length and buffersize
Date: Wed, 22 May 2024 17:17:02 +0000	[thread overview]
Message-ID: <20240522171640.iuol4672rnklc35g@synopsys.com> (raw)
In-Reply-To: <3f404a27-50e8-42c5-a497-b46751154613@rowland.harvard.edu>

On Wed, May 22, 2024, Alan Stern wrote:
> On Wed, May 22, 2024 at 01:41:42AM +0000, Thinh Nguyen wrote:
> > On Wed, May 22, 2024, Michael Grzeschik wrote:
> > > On Fri, May 17, 2024 at 01:44:05AM +0000, Thinh Nguyen wrote:
> > > > For isoc endpoint IN, yes. If the host requests for isoc data IN while
> > > > no TRB is prepared, then the controller will automatically send 0-length
> > > > packet respond.
> > > 
> > > Perfect! This will help a lot and will make active queueing of own
> > > zero-length requests run unnecessary.
> > 
> > Yes, if we rely on the current start/stop isoc transfer scheme for UVC,
> > then this will work.
> 
> You shouldn't rely on this behavior.  Other device controllers might not 
> behave this way; they might send no packet at all to the host (causing a 
> USB protocol error) instead of sending a zero-length packet.

I agree. The dwc3 driver has this workaround to somewhat work with the
UVC. This behavior is not something the controller expected, and this
workaround should not be a common behavior for different function
driver/protocol. Since this behavior was added a long time ago, it will
remain the default behavior in dwc3 to avoid regression with UVC (at
least until the UVC is changed). However, it would be nice for UVC to
not rely on this.

Side note, when the dwc3 driver reschedules/starts isoc transfer again,
the first transfer will be scheduled go out at some future interval and
not the next immediate microframe. For UVC, it probably won't be a
problem since it doesn't seem to need data going out every interval.

BR,
Thinh

> 
> On the other hand, it may not make any difference.  The host's UVC 
> driver most likely won't care about the difference between no packet and 
> a 0-length packet.  :-)
> 
> Alan Stern

  reply	other threads:[~2024-05-22 17:17 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-09 21:24 [PATCH 0/3] usb: gadget: uvc: allocate requests based on frame interval length and buffersize Michael Grzeschik
2024-04-09 21:24 ` [PATCH 1/3] usb: gadget: function: uvc: set req_size once when the vb2 queue is calculated Michael Grzeschik
2024-04-09 21:24 ` [PATCH 2/3] usb: gadget: uvc: add g_parm and s_parm for frame interval Michael Grzeschik
2024-04-09 21:24 ` [PATCH 3/3] usb: gadget: uvc: set req_size and n_requests based on the " Michael Grzeschik
2024-04-21 23:25 ` [PATCH 0/3] usb: gadget: uvc: allocate requests based on frame interval length and buffersize Michael Grzeschik
2024-04-23  0:21   ` Avichal Rakesh
2024-04-23 14:25     ` Michael Grzeschik
2024-04-23 23:23       ` Avichal Rakesh
2024-04-24  2:28         ` Thinh Nguyen
2024-05-12 22:10           ` Michael Grzeschik
2024-05-17  1:44             ` Thinh Nguyen
2024-05-22  0:08               ` Michael Grzeschik
2024-05-22  1:41                 ` Thinh Nguyen
2024-05-22 14:50                   ` Alan Stern
2024-05-22 17:17                     ` Thinh Nguyen [this message]
2024-05-22 17:37                       ` Michael Grzeschik
2024-05-22 18:23                         ` Thinh Nguyen
2024-05-22 18:58                         ` Alan Stern
2024-05-28 17:30                         ` Avichal Rakesh
2024-05-28 20:22                           ` Michael Grzeschik
2024-05-28 21:27                             ` Avichal Rakesh
2024-05-28 22:43                               ` Michael Grzeschik
2024-05-29  0:33                                 ` Avichal Rakesh
2024-05-29 21:24                                   ` Michael Grzeschik
2024-06-04 22:32                                     ` Avichal Rakesh
2024-06-10 21:44                                       ` Michael Grzeschik
2024-05-22 11:16         ` Michael Grzeschik

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=20240522171640.iuol4672rnklc35g@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=arakesh@google.com \
    --cc=dan.scally@ideasonboard.com \
    --cc=etalvala@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jchowdhary@google.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mgr@pengutronix.de \
    --cc=michael.riesch@wolfvision.net \
    --cc=stern@rowland.harvard.edu \
    /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