From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755527AbbJIU4I (ORCPT ); Fri, 9 Oct 2015 16:56:08 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:35406 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752223AbbJIU4E (ORCPT ); Fri, 9 Oct 2015 16:56:04 -0400 From: Felipe Balbi To: Clemens Ladisch , Felipe Tonello , USB list CC: Kernel development list , Peter Chen , Greg Kroah-Hartman , Andrzej Pietrasiewicz Subject: Re: [PATCH v3 1/4] usb: gadget: f_midi: free usb request when done In-Reply-To: <56178799.9000409@ladisch.de> References: <1443528119-31830-1-git-send-email-eu@felipetonello.com> <56178799.9000409@ladisch.de> User-Agent: Notmuch/0.20.2 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Fri, 9 Oct 2015 15:55:51 -0500 Message-ID: <871td3vk14.fsf@saruman.tx.rr.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Clemens Ladisch writes: > Felipe Tonello wrote: >> req->actual =3D=3D req->length means that there is no data left to enque= ue, > > This condition is not checked in the patch. > >> so free the request. >> >> Signed-off-by: Felipe F. Tonello >> --- >> drivers/usb/gadget/function/f_midi.c | 5 ++--- >> 1 file changed, 2 insertions(+), 3 deletions(-) >> diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/f= unction/f_midi.c >> index edb84ca..93212ca 100644 >> --- a/drivers/usb/gadget/function/f_midi.c >> +++ b/drivers/usb/gadget/function/f_midi.c >> @@ -256,9 +256,8 @@ f_midi_complete(struct usb_ep *ep, struct usb_reques= t *req) >> /* We received stuff. req is queued again, below */ >> f_midi_handle_out_data(ep, req); >> } else if (ep =3D=3D midi->in_ep) { >> - /* Our transmit completed. See if there's more to go. >> - * f_midi_transmit eats req, don't queue it again. */ >> - f_midi_transmit(midi, req); >> + /* Our transmit completed. Don't queue it again. */ >> + free_ep_req(ep, req); >> return; >> } >> break; > > The ALSA framework will give you a notification _once_. If the > resulting data is larger than midi->buflen, then you have to continue > sending packets. This is exactly what the call to f_midi_transmit() > does. > > (To decrease latency, it might be a good idea to queue multiple requests, > but you wouldn't want to continue piling up requests if the host isn't > listening. sound/usb/midi.c just allocates a fixed number of requests, > and always reuses them.) so, should I drop this series from my TODO queue ? =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWGCnYAAoJEIaOsuA1yqRE52YP/jnYKGZW3kKbtEmwmFzZjGJs 01E8BMvdhsv0Rtcy2DDGaYSIr6Ynyn11CvfXhei7HzzAHZfCsWzUmbFqXuVCUXu5 Ocn9umEwWKJio2GzIa6Q3iqjpbHfygeNTWcrmQb3nnCQZ/+roPCOIo0yZbV0K8Dw qAOLhIgoKHbtSkRb7VmCjFaziUL+HEguXwM+9hdmxGbfHfy3yrEDbwXTuhpdeekf zh2wxbNM1tH1Wp2b/Q/h7DiidwBxgxvpqesd4x168ju7/9Y8NswO4gywDfnOHlQk 8IOAXHyUNcigPkn2rgZl2L5eCAaHKpmXTLbyCH1g5t+hlUzMHtUq9G8ogaVXgYMT V6ZAkM2cWiSdXFFfeoUcSZ6TBj+W1FRmvQ+fDka1Boqvz2SnHVpjnm61etRgB3mB P8XX+uTViBMBKI0lCNOMPps+Pdylm5WdYel6M4nAEZOKYt6Cwe+HvS/PXApny231 wQy6xFcgSK0ZT+nfEe+/F3Gv/cDXVdTxL1o60d2Y6IfErIDP7r+k+8mr0tSyyx+s 8h6+AA5r0aNDBAgfr4xMhb0uYxZUL7+mnXjVx6CT9suDmqlFro7Qm+P+FZ6+U8KP EhxLdGlTm5dYWu5yCBNfBz6V6MZJG3RRDIpfeMABU9b0wkOH0ZMsTnu9Zw/Ft3rh r7smOjCtH0YScXPjSSAF =xAKS -----END PGP SIGNATURE----- --=-=-=--