[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <xa1tmvnno58g.fsf@mina86.com>
Date: Wed, 18 May 2016 15:39:11 +0200
From: Michal Nazarewicz <mina86@...a86.com>
To: Felipe Balbi <felipe.balbi@...ux.intel.com>,
"Du\, Changbin" <changbin.du@...el.com>,
Alan Stern <stern@...land.harvard.edu>
Cc: Al Viro <viro@...iv.linux.org.uk>,
"gregkh\@linuxfoundation.org" <gregkh@...uxfoundation.org>,
"rui.silva\@linaro.org" <rui.silva@...aro.org>,
"k.opasiak\@samsung.com" <k.opasiak@...sung.com>,
"lars\@metafoo.de" <lars@...afoo.de>,
"linux-usb\@vger.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] usb: gadget: f_fs: report error if excess data received
On Wed, May 18 2016, Felipe Balbi wrote:
> we've been through this before. This needs to be done at the gadget
> layer. Gadget driver can over-allocate ahead of time if
> gadget->quirk_ep_out_aligned_size is true, then we avoid memcpy() at
> the UDC driver level.
Right, all right, so let’s look at it from a regular USB function point
of view. If a USB function allocates a request which is not aligned,
UDC will align the buffer and *drop* excess data. Seeing how ugly
f_fs’s code is becoming, I’m now leaning to letting to f_fs do the same
thing: if user space makes an unaligned read, f_fs aligns the buffer and
then drops excess data.
Any arguments for f_fs to not drop the data apply to UDC, so they should
behave identically.
--
Best regards
ミハウ “𝓶𝓲𝓷𝓪86” ナザレヴイツ
«If at first you don’t succeed, give up skydiving»
Powered by blists - more mailing lists