Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755002AbcDAKZK (ORCPT ); Fri, 1 Apr 2016 06:25:10 -0400 Received: from mga03.intel.com ([134.134.136.65]:32201 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754712AbcDAKZH (ORCPT ); Fri, 1 Apr 2016 06:25:07 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,427,1455004800"; d="asc'?scan'208";a="949517115" 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: <56FE3E90.9020305@felipetonello.com> References: <1457552370-29404-1-git-send-email-eu@felipetonello.com> <87wpokp7bu.fsf@intel.com> <56FE3E90.9020305@felipetonello.com> User-Agent: Notmuch/0.21+96~g9bbc54b (http://notmuchmail.org) Emacs/25.0.90.3 (x86_64-pc-linux-gnu) Date: Fri, 01 Apr 2016 13:22:46 +0300 Message-ID: <87mvpd8w7d.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: 2209 Lines: 60 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Felipe Ferreri Tonello writes: > Hi Balbi and Mina, > > 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. >>=20 >> D=E2=80=99oh. Of course. Disregard all my comments on the patch (excep= t for >> Ack). >>=20 > > 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) 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). You don't need to break these 2048 bytes into several requests yourself, the UDC is required to do that for the gadget. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW/kv3AAoJEIaOsuA1yqREY3sP/1JiSEr3vg3r4U6tAUxIz7nL GDnJ7tIMGMyVFnySE+PRuoq1+7IvwmkluvdD0nfucFr9+nlxKxMmY/fMaa06CAzD L4J6Q1E3dHj81sKL+hVjTiqDQJSE0wlPuouJ+WBsc8RGL9wbhU8+LYdWHEY4D831 rpt+1mwxaGcz6j3X2xQw8Orv+mdV9rLgkMJ0mLeU1TpPuGefHHJaDGiZNT4pzJ6y RtAb/M20Ab15arlCsJeNz4N7RP2KYzMB0EWqb8hkP6hFtQsx6tCfIM7OoZPYbUUP 7txAsQUaPx1OG0sbZbUxF7ozbpwmvEK0mVIb/U9kcv89q0bLH1cL1v0lfnZwgjQs MwdWVfqawrhSXfZbNk/sybkS6w6zM591qlI18Bf9r1f7TCK9BZUQw+3FPp7xhXQ8 8tn9qcG/35TXDI0bHFCTJmad4mHB/L6t1zQf8m97VRri/GUT+V9AfSoGDnuMgXHE HAs+e8FgULEEK0TgTn7TYUI3S2+FdDY4b1HHhjyp3lpWLagChQzd63c0SvoGkPTB A6rQKOFBwrjQi2nogzh6f8kMd9gIWQVtiS/rFBdsKK6sKgLtlXDA37dSv3A5ErE6 FjtLiCL8Aq8JaAoATJsf2MqrMJXxnGmg1uWmQmF2sDfNoQKfcCl64zxxSRPDobdp Nt6d+RcmR9lYHCIWJBn+ =PzFy -----END PGP SIGNATURE----- --=-=-=--