Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755233AbcDDKsq (ORCPT ); Mon, 4 Apr 2016 06:48:46 -0400 Received: from mga04.intel.com ([192.55.52.120]:54888 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755202AbcDDKsp (ORCPT ); Mon, 4 Apr 2016 06:48:45 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,440,1455004800"; d="asc'?scan'208";a="947562926" From: Felipe Balbi To: Felipe Ferreri Tonello , Michal Nazarewicz , linux-usb@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Robert Baldyga Subject: Re: [PATCH] usb: gadget: f_midi: Fixed a bug when buflen was smaller than wMaxPacketSize In-Reply-To: <56FE8B40.7050809@felipetonello.com> References: <1457552370-29404-1-git-send-email-eu@felipetonello.com> <87wpokp7bu.fsf@intel.com> <56FE3E90.9020305@felipetonello.com> <87mvpd8w7d.fsf@intel.com> <56FE8B40.7050809@felipetonello.com> User-Agent: Notmuch/0.21+96~g9bbc54b (http://notmuchmail.org) Emacs/25.0.90.3 (x86_64-pc-linux-gnu) Date: Mon, 04 Apr 2016 13:46:21 +0300 Message-ID: <87a8l97ite.fsf@intel.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-Length: 2293 Lines: 62 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Felipe Ferreri Tonello writes: >>> On 30/03/16 13:33, Michal Nazarewicz wrote: >>>> On Wed, Mar 30 2016, Felipe Balbi wrote: >>>>> a USB packet, right. that's correct. But a struct usb_request can >>>>> point to whatever size buffer it wants and UDC is required to split >>>>> that into wMaxPacketSize transfers. >>>> >>>> D=E2=80=99oh. Of course. Disregard all my comments on the patch (exc= ept for >>>> Ack). >>>> >>> >>> I didn't really get it. Does that mean that if buflen is multiple of >>> wMaxPacketSize, the UDC driver should fit as many [DATA] packets into >>> one usb_request and call complete() or it will always call complete() on >>> each [DATA] packet, thus not requiring buflen at all? >>> >>> Does that mean that we can still use buflen and this patch is still >>> valid? (besides the endianess issue that was addressed on v2) >>=20 >> if you have e.g. 2048 bytes of data to transfer and wMaxPacketSize is >> e.g. 256 bytes, the UDC controller is required to do whatever it needs >> to do to transfer 2048 bytes (or less if there's a short packet). >>=20 >> You don't need to break these 2048 bytes into several requests yourself, >> the UDC is required to do that for the gadget. > > Right, what about OUT endpoints? also applicable =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXAkX+AAoJEIaOsuA1yqREnuYQAI16282I5phfuAH/I6J8aFHG aoLt0E2gH4R86bWR9o7mvmekYk0br9dkl+fz2xYtby3r6Y9YrUh+r5cx2ZUUDll0 J5Tc7OqGCluszVj0GB0toZmNp0gaRyjDgJbFvY4QzTWrP6XPwMg1a/xmUaOe3PW5 az83VcIAY/qky9eE/AX/EYTMYGV5uXwELmT6QpjJQPZ4uNQkPdkWbfQKq4ac+O3w Qd5rqJu9V3Dr9H4nL9TFs3GpREdBPT5tJuGUtTfMYIgMAi3JTX1hun7gIiul38qJ +aTLmuJz9NuY4OcOCMZG7MX2KNFEtXVi/pYYY/sD04VFIeySdzdyNUsmYCIp5lHo 2lt9GW6W1Y0eqVDs35EPOzMz3kPEKujNTk71YdyY+GjyChEoE/3o0qgoGe/P3zx2 z+gMV8UZSSJjMdZQKxjwW+idwn/7jc1DZULBlJEAeHNvYzN2Nu0w1NI2Jvl3c3K5 o6l3am6fr3IA4gI9vlw7eTindhnBmrXNBrxil04SaPw+T1Og6MX+qcu8aN5tqVgy iYJ06KwwzKS//8O+cUDw03U4pO86ib7bV4YSP/qMDjBA/BK+R/3slGorC2Xologp vj9RzjlMj1loRrOrXClBDl0ahzt0hPfkuWGdzy1XMueo7bFP9i1PNaI+dzZJOgXC zID30oWSyiHpB/oQTCUQ =kL+v -----END PGP SIGNATURE----- --=-=-=--