Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp506056lqp; Wed, 22 May 2024 10:38:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVkI8SyMCx+m4kor8ILfehMnRo5Y/cjo4FAgDuGlFJwltY+wE44ajqe2cUIIoK5Mz5lsQyTLwQzPVI9UKPozPbWk659Cwj45bqMaunlvQ== X-Google-Smtp-Source: AGHT+IFqiqSObqrvk9sweLbWdf363lRmfufyOHXXvLEqblch5cnt7Dv8v79O+09mkMXvkTyOFWOb X-Received: by 2002:a05:6a21:2725:b0:1b1:d371:335e with SMTP id adf61e73a8af0-1b1f883b620mr2769505637.17.1716399511752; Wed, 22 May 2024 10:38:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716399511; cv=pass; d=google.com; s=arc-20160816; b=K8gZ9l/kNMGsQdixed5ImymmFE2I5rcYLuyo5i5Y9Q2r5EKZGIe3PKMNBtyQwkVdNb szVg4fkPhXEhAbFhWXgsaIDZG+U4W1855UDPzCIxjbdtMa/JO2JwRVkSWx3C4CIdNcKJ eP7v7gskx1tRn7dQ5sTOijKYrPcMZ3Y0IKGaEG6JwDUx98vF0S6rDRgaL6tm+KwKIqJa Uk0jx7ydSppMNRweaS2p23NzbYjEwqpypLI7ulXB6hwdDkUOCbPwVcHEdc9SYZBLkyjj cJupjGs/4i31I2OiACk8Yffc1QFfJPioZm6VbamI9LYC4WBF9VOStlT5Weq8rp5VmPck SCJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=g0isc0tqRgAiXEW9/Ux9kOjE51pZt0mJsiD0LVdLIx0=; fh=67R8TZflTopQah4bho0cUxlyXEq0VXUaOuoAdWgwxJ4=; b=JlrJl5LTtYIV1XUKtLEzksYBF+TjpXhnMfHIn3o7mX3hruzPe1uaT4fur3MgqKVorC haguL8H0RQAv5lLeeo6YAR6LJgAXwQjbBgpCha9r4yCRvP0ZEQ5QlISqUU+1KyM83B/l B1yuwo09jJZj1Rxdk29sk7eiyN2WUInLVOG+3LQhY2rJ9pKNf01DWh20IaVuuNDZbDEB 0D3y0/U8wsk6rrfwXXPIiIgIALtygv2ToejOpuEOXcL/7to9tikyyeP7FS8bcui9OZHp OKquaNdFUfz8Ext4fNIsynuoA9sAVgF9BJs0n6+r2l66XfrEWJfVGhPbC5P3vjT25nUR i04w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-186563-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186563-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-65705222ff8si6160920a12.363.2024.05.22.10.38.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 10:38:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186563-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-186563-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186563-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8FD7F280E8C for ; Wed, 22 May 2024 17:38:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C4B421442F2; Wed, 22 May 2024 17:38:20 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64F2682862 for ; Wed, 22 May 2024 17:38:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716399500; cv=none; b=Q0nF7rIcRmGHQHDrvhmpY+qd6yco3/Mi8fXg7/ox7QsYtFH6UZ7/i2mj8NLFDAQ1WfdNqHygvCXQh6Uwfp2IV+GRiNz5G2jj3V1TRJY2wC/6Axbw5gnL9lyJwdsjSVcJM7AHdXGMkDRaUbWiE0JPHT0aM9OgbMlAnwEwH0PjeRc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716399500; c=relaxed/simple; bh=2C1MrL6VrEGrQifZYSpph07toGJPn6imKhGMsEe1EaM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=U2jHMqhGjya3uuVpnFENUQQhzc5b/gWA7AnnDhx1nH9W7C/OkL1+2GKWloJUUwO5mY+LcFJXxtZ8IdIz2DuUuNOcZ46USwn9KJuaRFZnQZc3V5REb7tSg7wZ7pJaE6L9SbpztUBsU6Oq1jjWC4CwaqHRXvj3QKHRrKqbOTr03aw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s9pub-0005XM-1A; Wed, 22 May 2024 19:38:01 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s9puZ-002YUa-Af; Wed, 22 May 2024 19:37:59 +0200 Received: from mgr by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1s9puZ-0081fV-0l; Wed, 22 May 2024 19:37:59 +0200 Date: Wed, 22 May 2024 19:37:59 +0200 From: Michael Grzeschik To: Thinh Nguyen Cc: Alan Stern , Avichal Rakesh , Laurent Pinchart , Daniel Scally , Greg Kroah-Hartman , Jayant Chowdhary , "etalvala@google.com" , Michael Riesch , "linux-usb@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 Message-ID: References: <17192e0f-7f18-49ae-96fc-71054d46f74a@google.com> <20240424022806.uo73nwpeg63vexiv@synopsys.com> <20240517014359.p2s44ypl4bix4odm@synopsys.com> <20240522014132.xlf7azgq2urfff2d@synopsys.com> <3f404a27-50e8-42c5-a497-b46751154613@rowland.harvard.edu> <20240522171640.iuol4672rnklc35g@synopsys.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KlD9DUoS1lZZbWhj" Content-Disposition: inline In-Reply-To: <20240522171640.iuol4672rnklc35g@synopsys.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: mgr@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org --KlD9DUoS1lZZbWhj Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 22, 2024 at 05:17:02PM +0000, Thinh Nguyen wrote: >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 w= hile >> > > > 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. With "this" you mean exactly the following commit, right? (f5e46aa4 usb: dwc3: gadget: when the started list is empty stop the active= xfer) When we start questioning this, then lets dig deeper here. With the fast datarate of at least usb superspeed shouldn't they not all completely work asynchronous with their in flight trbs? In my understanding this validates that, with at least superspeed we are unlikely to react fast enough to maintain a steady isoc dataflow, since the driver above has to react to errors in the processing context. This runs the above patch (f5e46aa4) a gadget independent solution which has nothing to do with uvc in particular IMHO. How do other controllers and their drivers work? >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. It should not make a difference. [TM] >> >> 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 --=20 Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --KlD9DUoS1lZZbWhj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEElXvEUs6VPX6mDPT8C+njFXoeLGQFAmZOLXMACgkQC+njFXoe LGTrlw//acfVnAqXm30yItASBO4NznjTsgBCE37biI3jt0FeeUjN8IG1K5uSTyme yRs7UsOhZE9Me82unKkoyKtv66lTfoWmC7CExQ5jk1WQLX+mYhEj5SaGvHMawH29 w7WhxbO/8VeeQxcLC/GBP9KYn+bPWtkw4HgUo729EZbAPHPi1G6XDGYbMlAqM56R nKAtE00l5HNMXqAGIjpbiz+NVkQGMjvawhWbuqDTGZKP1eBtug6b7WSkno8OO0NP Y42jtmRMhftj19KeXepFGD7Mgj4+YiaOUjtLxV2RdQ9i4VW9WJrCEdXApt1yaN3Z UBFR5p9JyGEKFcTGX8sNETAUvAVEI2bNbg1kmiP83owosR+Bsw5srkaV7vic8HHB u50xxeVjVAAa3D3lo6ZQ+QGCbH5fIYxSjWtRTANRAETSIUS1M6yCRRVm00AiuY0J KVVzRYeeZiqqOB1JwXB8egv3eAuM8sVgkWBWZWkkqqNjsXTxaVZvHxSbT648+mJ3 O3lfQTxkQD0E3wowqi3bcLR6seXQXMYl3ecnWsV8Kg83svk0NKTPS4Yq/e3HfBFr XbqvQnc10TFPr+2Bk6HXYjAq4Vhc07P4rN8r+OKLiKCLwod6YJX0BwNET1vQ2WQH QahUngNv7o+h5uT6QKVM7vBVkMqESbvi1JDOoofdXmAyUlZf6Pk= =UQf6 -----END PGP SIGNATURE----- --KlD9DUoS1lZZbWhj--