From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934859AbbIVVOa (ORCPT ); Tue, 22 Sep 2015 17:14:30 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:54454 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933893AbbIVVO3 (ORCPT ); Tue, 22 Sep 2015 17:14:29 -0400 Date: Tue, 22 Sep 2015 16:14:15 -0500 From: Felipe Balbi To: "Felipe F. Tonello" CC: , , Peter Chen , Greg Kroah-Hartman , Felipe Balbi , Andrzej Pietrasiewicz Subject: Re: [PATCH 2/3] usb: gadget: f_midi: free usb request when done Message-ID: <20150922211415.GE7094@saruman.tx.rr.com> Reply-To: References: <1442948350-31702-1-git-send-email-eu@felipetonello.com> <1442948350-31702-2-git-send-email-eu@felipetonello.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SWTRyWv/ijrBap1m" Content-Disposition: inline In-Reply-To: <1442948350-31702-2-git-send-email-eu@felipetonello.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --SWTRyWv/ijrBap1m Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 22, 2015 at 07:59:09PM +0100, Felipe F. Tonello wrote: > req->actual =3D=3D req->length means that there is no data left to enqueu= e, > so free the request. >=20 > Signed-off-by: Felipe F. Tonello > --- > drivers/usb/gadget/function/f_midi.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/fu= nction/f_midi.c > index edb84ca..e92aff5 100644 > --- a/drivers/usb/gadget/function/f_midi.c > +++ b/drivers/usb/gadget/function/f_midi.c > @@ -258,7 +258,10 @@ f_midi_complete(struct usb_ep *ep, struct usb_reques= t *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); > + if (req->actual < req->length) > + f_midi_transmit(midi, req); > + else > + free_ep_req(ep, req); I'd have to have a deeper look at f_midi, but this doesn't look correct to me. Why do you think that we should stop queueing requests when we transfer one in full ? --=20 balbi --SWTRyWv/ijrBap1m Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWAcSmAAoJEIaOsuA1yqRE7PoP/0UWci3gaJL1saYwBgBalKmX 7/gd3D37rghSwxSbB+7vWjJlWmGGyUyT5yEurU4MxEM3knI7p2HmM8wclDvdzTd6 s1lsgAQxA+vQcObHz/oPOrATeg+VbwHiJwWBXkPdv2BjknMu8fZSCBsHFMCqXsJt jUuNfSJZGNXxqRZDf0vasx+0lbc0ZCrOpVKr7T4IRrkB/Q7evG8ZrVRp/HZRzc9F 2VRyWPxmQ1SLmWnDBv8xkJLURppRQC6Xjt/QnOEy6DwyivwRQe75Zy/JjeaMmRSH onD4rJYUNWHdWamHnA7EoNJaUzDTSZLqPN79V6vXSjXEmMPLNzLKZVNsfmFFEWyA mntuIC9rkpAvnobl1nX+vNc1lkPWKEe0h7uSTiV3hjf46CWQGMP3D32y0Fi0DL+4 AK0hER5w1rQdvmiAf2dAESEXT85p77HOPzNRe1Ul7B52DJJ3EtUnJqbF03Tznhfu 7RvGsNi9cnqCvXrwaWdV/2eENGXW9auGJh1jANSZn4fxJFPjN3L+7tMHgC/9EPSV CUl4mWRjcKpJSYcWcQ/Cj+i6bNSyHWFq8zLdKIpQmUfKSHSlyvvTsjN+Ez495j7j nhoiAZV97FKP3+xBt6hdvFtbr0dvnErL2JQHjkTWMHW/cpCNVHO6IjS2fVKEgY8v ccSjXtSDRblJ/Aj+C0Lw =2bU3 -----END PGP SIGNATURE----- --SWTRyWv/ijrBap1m--