elipe Balbi
> Cc: Laurent Pinchart
> Cc: Oliver Neukum
> Cc: Johan Hovold
> Cc: Michal Nazarewicz
Acked-by: Michal Nazarewicz
> Cc: Vincent Pelletier
> Cc: Jerry Zhang
> Cc: John Keeping
> Cc: Krzysztof Opasiak
> Cc: Abdulhadi Mohamed
> Cc: Mat
t be called, so there is no
> reason to make del_timer_sync() calls conditional. As a result, use of
> the .data field can be dropped, in support of making removing this field
> entirely from struct timer_list.
>
> Cc: Felipe Balbi
> Cc: Greg Kroah-Hartman
> Cc: Raviteja Garimella
tion in a larger composite device. Therefore the
> entire mechanism responsible for this (the fsg_operations structure
> with its ->thread_exits method, the fsg_common_set_ops() routine, and
> the msg_thread_exits() callback routine) can all be elimi
list.
>
> Cc: Felipe Balbi
> Cc: Greg Kroah-Hartman
> Cc: Raviteja Garimella
> Cc: Michal Nazarewicz
Acked-by: Michal Nazarewicz
> Cc: "Gustavo A. R. Silva"
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Kees Cook
> ---
> drivers/usb/gadget/udc/snps
ctionFS so that data completed
> requests is passed to userspace in the order in which they complete.
>
> Signed-off-by: John Keeping
Acked-by: Michal Nazarewicz
> ---
> I originally sent a version of this patch back in July [1] without any
> response. Since then, I
c: Raviteja Garimella
> Cc: Michal Nazarewicz
> Cc: "Gustavo A. R. Silva"
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Kees Cook
> ---
> drivers/usb/gadget/udc/snps_udc_core.c | 16 +---
> 1 file changed, 5 insertions(+), 11 deletions(-)
>
>
On Mon, Aug 14 2017, Jerry Zhang wrote:
> On Mon, Aug 14, 2017 at 7:26 AM, Michal Nazarewicz wrote:
>> On Fri, Aug 11 2017, Jerry Zhang wrote:
>>> Users can apply i/o in the wrong direction on an
>>> endpoint to stall it. In case there is an error
>>> th
On Fri, Aug 11 2017, Jerry Zhang wrote:
> Users can apply i/o in the wrong direction on an
> endpoint to stall it. In case there is an error
> that does not allow the endpoint to be stalled,
> we want the user to know.
>
> An operation to stall the endpoint will return
> EBADMSG if successful, EAGA
On Fri, Jun 09 2017, Axel Lin wrote:
> It is wrong to do --i in the for loop.
>
> Fixes: dd02ea5a3305 ("usb: gadget: mass_storage: Use static array for luns")
> Signed-off-by: Axel Lin
Acked-by: Michal Nazarewicz
> ---
> drivers/usb/gadget/function/f_mass_storage.c
ot;GFP_ATOMIC".
>
> Signed-off-by: Jia-Ju Bai
Acked-by: Michal Nazarewicz
> ---
> drivers/usb/gadget/function/f_fs.c |2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/function/f_fs.c
> b/drivers/usb/gadget/function/f_f
On Sat, May 13 2017, Geliang Tang wrote:
> Use memdup_user() helper instead of open-coding to simplify the code.
>
> Signed-off-by: Geliang Tang
Acked-by: Michal Nazarewicz
> ---
> drivers/usb/gadget/function/f_fs.c | 11 +++
> 1 file changed, 3 insertions(+), 8 del
On Fri, Apr 21 2017, Felipe Balbi wrote:
> why would it have to do that? We would allocate a new struct
> usb_request, allocate a new buffer, copy_from_user() and
> usb_ep_queue(). Why would we return -EAGAIN?
Nvm. Of course you’re right.
>> What if user space doesn’t want to read? If kernel sp
mpletion_interruptible() is what's killing
>>> performance. Each and every read/write waits for the USB side to
>>> complete. It would've been much better to have something like:
>>>
>>> if (flags & O_NONBLOCK)
>>> wait_for_completion
On Fri, Apr 21 2017, Felipe Balbi wrote:
> Hi Jerry,
>
> Jerry Zhang writes:
>> (reposting this question in its own subject, instead of buried in a patchset)
>>
>> Android has migrated to using f_fs for the mtp function, but in the
>> process we ran into some performance hiccups in comparison to f
of endpoints being enabled.
>
> ESHUTDOWN is now a possible return value and ENODEV is not, so change
> docs accordingly.
>
> Signed-off-by: Jerry Zhang
Acked-by: Michal Nazarewicz
> ---
> Changelog since v2:
> - Updated doc to account for -ESHUTDOWN
>
> Changelog s
; Previously, calling ioctls before read/write would depending on the
> timing of endpoints being enabled.
>
> Signed-off-by: Jerry Zhang
Acked-by: Michal Nazarewicz
> ---
> Changelog since v1:
> - Guarded against epfile->ep changing after taking lock
>
On Tue, Apr 18 2017, Jerry Zhang wrote:
> Also change the docs to reflect that ENODEV is no longer returned.
>
> This allows users to make an ioctl call as the first action on a
> connection. Ex, some functions might want to get endpoint size
> before making any i/os.
>
> Previously, calling ioctls
fs_data makes more sense and is less redundant.
>
> Also use wake_up_interruptible to reflect use of
> wait_event_interruptible.
>
> Signed-off-by: Jerry Zhang
Acked-by: Michal Nazarewicz
> ---
> drivers/usb/gadget/function/f_fs.c | 19 ++-
> drivers/usb/
On Tue, Apr 18 2017, Jerry Zhang wrote:
> The comment for this states that it returns -ENODEV
> when the function is inactive. Really, an inactive
> function is treated as having no interfaces, so -EDOM
> is returned.
Uh? Than what’s this:
if (code == FUNCTIONFS_INTERFACE_REVMAP) {
the sleeper.
>
> However, a better solution in the future would be to use wait_queue
> method that takes care of managing memory barrier between waker and
> waiter.
>
> See DEFINE_WAIT_FUNC comment in kernel scheduling wait.c as this
> solution is similar to its implementation.
>
>
actual amount is not immediately obvious
and depends on pointer size and which slab buckets the structure
and name would fall into).
Signed-off-by: Michal Nazarewicz
---
drivers/usb/gadget/function/f_fs.c | 72 +++---
drivers/usb/gadget/function/u_fs.h | 11 +++---
2
actual amount is not immediately obvious
and depends on pointer size and which slab buckets the structure
and name would fall into).
Signed-off-by: Michal Nazarewicz
---
drivers/usb/gadget/function/f_fs.c | 79 --
drivers/usb/gadget/function/u_fs.h | 11 +++---
2
Reported-by: Gustavo A. R. Silva
Signed-off-by: Michal Nazarewicz
---
drivers/usb/gadget/udc/mv_udc_core.c | 13 ++---
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/gadget/udc/mv_udc_core.c
b/drivers/usb/gadget/udc/mv_udc_core.c
index 27ebb0d5449d..76f56c5762f9
On Mon, Feb 13 2017, Gustavo A. R. Silva wrote:
> Rewrite udc_free_dma_chain() function to avoid use of pointer after free.
>
> Addresses-Coverity-ID: 1091172
> Reviewed-by: Greg Kroah-Hartman
> Signed-off-by: Gustavo A. R. Silva
Acked-by: Michal Nazarewicz
> ---
> d
On Mon, Feb 13 2017, Gustavo A. R. Silva wrote:
> Remove unnecessary variable and update function prototype.
>
> Reviewed-by: Greg Kroah-Hartman
> Signed-off-by: Gustavo A. R. Silva
Acked-by: Michal Nazarewicz
> ---
> drivers/usb/gadget/udc/amd5536udc.c | 5 +
&g
On Sat, Feb 11 2017, Gustavo A. R. Silva wrote:
> Remove pointer dereference after free and set pointer to NULL after free.
>
> Addresses-Coverity-ID: 1091173
> Signed-off-by: Gustavo A. R. Silva
Acked-by: Michal Nazarewicz
> ---
> Changes in v2:
> Move point
actual amount is not immediately obvious
and depends on pointer size and which slab buckets the structure
and name would fall into).
Signed-off-by: Michal Nazarewicz
---
drivers/usb/gadget/function/f_fs.c | 79 --
drivers/usb/gadget/function/u_fs.h | 11 +++---
2
Reported-by: Gustavo A. R. Silva
Signed-off-by: Michal Nazarewicz
---
drivers/usb/gadget/udc/mv_udc_core.c | 13 ++---
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/gadget/udc/mv_udc_core.c
b/drivers/usb/gadget/udc/mv_udc_core.c
index d82a91bddbd9..7440c9f92ec1
On Wed, Feb 08 2017, Felipe Balbi wrote:
> Hi,
>
> "Gustavo A. R. Silva" writes:
>> Add missing break in switch.
>>
>> Addresses-Coverity-ID: 201385
>> Signed-off-by: Gustavo A. R. Silva
>> ---
>> drivers/usb/gadget/udc/mv_udc_core.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/dr
callbacks ever return NULL, a null pointer dereference will
happen.
Be defensive about it and check in those functions whether the callbacks
(incorrectly) returned NULL and interpret it as ENOMEM error pointer
instead.
Signed-off-by: Michal Nazarewicz
---
drivers/usb/gadget/functions.c |
fput+0xb0/0x1f4
> [ 52.642633] c1 [] fput+0x20/0x2c
> [ 52.642636] c1 [] task_work_run+0xb4/0xe8
> [ 52.642640] c1 [] do_exit+0x360/0xb9c
> [ 52.642644] c1 [] do_group_exit+0x4c/0xb0
> [ 52.642647] c1 [] get_signal+0x380/0x89c
> [ 52.642651] c1 [] do_signal+0x154/0
epfile->ep is protected by ffs->eps_lock (not epfile->mutex) so clear it
while holding the spin lock.
Signed-off-by: Michal Nazarewicz
---
drivers/usb/gadget/function/f_fs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/gadget/function/f_fs.c
ffs_func_eps_disable is called from atomic context so it cannot sleep
thus cannot grab a mutex. Change the handling of epfile->read_buffer
to use non-sleeping synchronisation method.
Reported-by: Chen Yu
Signed-off-by: Michał Nazarewicz
Fixes: 9353afbbfa7b ("buffer data from ‘oversized’ OUT req
On Mon, Oct 03 2016, John Stultz wrote:
> On Wed, Sep 28, 2016 at 2:38 PM, Michal Nazarewicz wrote:
>> On Wed, Sep 28 2016, Michal Nazarewicz wrote:
>>> With that done, the only thing which needs a mutex is
>>> epfile->read_buffer.
>>
>
On Wed, Sep 28 2016, Michal Nazarewicz wrote:
> With that done, the only thing which needs a mutex is
> epfile->read_buffer.
Perhaps this would do:
>8 -- -
>From 6416a1065203a39328311f6c58083089efe169aa Mon Sep 1
bug in the code and we need to do this:
--- >8 -
>From 0ce6cc5e2440800243eff06c6952cba0f976da2f Mon Sep 17 00:00:00 2001
From: Michal Nazarewicz
Date: Wed, 28 Sep 2016 18:10:42 +0200
Subject: [PATCH] usb: gadget: f_fs: edit
; Signed-off-by: Daniel Wagner
> Cc: Felipe Balbi
> Cc: Michal Nazarewicz
Acked-by: Michal Nazarewicz
> Cc: Greg Kroah-Hartman
> Cc: linux-usb@vger.kernel.org
> ---
> drivers/usb/gadget/function/f_fs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff
On Fri, Aug 05 2016, Felipe F. Tonello wrote:
> 512 is the value used by wMaxPacketSize, as specified by the USB Spec. This
> makes sure this driver uses, by default, the most optimal value for IN and OUT
> endpoint requests.
>
> Signed-off-by: Felipe F. Tonello
Acked-by: Mi
ich does always returns the
> aligned buffer size for an endpoint. This is useful to be used by USB requests
> allocator functions.
>
> Signed-off-by: Felipe F. Tonello
Acked-by: Michal Nazarewicz
> ---
> include/linux/usb/gadget.h | 17 ++---
> 1 file ch
On Wed, Aug 03 2016, Oliver Neukum wrote:
> Before we think about that, the basic question whether
>
> S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
>
> is clearer and easier to read than
>
> 0644
>
> must be decided. I would saz no, it is not.
I was about to write the same thing.
I dislike magic numbers
On Tue, Jul 26 2016, Felipe F. Tonello wrote:
> Use gadget's framework allocation function instead of directly calling
> usb_ep_alloc_request().
>
> Signed-off-by: Felipe F. Tonello
Acked-by: Michal Nazarewicz
> ---
> drivers/usb/gadget/function/f_hid.c | 6 +---
On Tue, Jul 26 2016, Felipe F. Tonello wrote:
> We should always use free_ep_req() when allocating requests with
> alloc_ep_req().
>
> Signed-off-by: Felipe F. Tonello
Acked-by: Michal Nazarewicz
> ---
> drivers/usb/gadget/function/f_hid.c | 10 +++---
> 1 file change
me.
> create an inline function to pass the same value to len and default_len.
>
> So this patch also removes duplicate code from few drivers.
>
> Signed-off-by: Felipe F. Tonello
Acked-by: Michal Nazarewicz
> ---
> drivers/usb/gadget/function/f_hid.c| 10 ++--
On Tue, Jul 26 2016, Felipe F. Tonello wrote:
> Using usb_ep_align() makes sure that the buffer size for OUT endpoints is
> always aligned with wMaxPacketSize (512 usually). This makes sure
> that no buffer has the wrong size, which can cause nasty bugs.
>
> Signed-off-by: Felipe F. Tonello
> ---
On Tue, Jul 26 2016, Felipe F. Tonello wrote:
> 512 is the value used by wMaxPacketSize, as specified by the USB Spec. This
> makes sure this driver uses, by default, the most optimal value for IN and OUT
> endpoint requests.
>
> Signed-off-by: Felipe F. Tonello
Acked-by: Mi
ich does always returns the
> aligned buffer size for an endpoint. This is useful to be used by USB requests
> allocator functions.
>
> Signed-off-by: Felipe F. Tonello
Acked-by: Michal Nazarewicz
> ---
> include/linux/usb/gadget.h | 17 ++---
> 1 file ch
it is need to align
> the request buffer's size to an ep's maxpacketsize.
>
> Signed-off-by: Baolin Wang
> Acked-by: Michal Nazarewicz
> ---
> Changelog since v1:
> - Remove the in_ep modification.
> - Remove max_t() function.
>
> drivers/usb/gadget/func
[NAK]
> ...
> HOST: [PING]
> DEVICE: [NAK]
>
> This patch fixes this problem by setting the minimum usb_request's buffer
> size
> for the OUT endpoint as its wMaxPacketSize.
>
> Acked-by: Michal Nazarewicz
> Signed-off-by
> Baolin Wang writes:
>> @@ -359,10 +361,12 @@ static int f_midi_set_alt(struct usb_function *f,
>> unsigned intf, unsigned alt)
>>
>> /* allocate a bunch of read buffers and queue them all at once. */
>> for (i = 0; i < midi->qlen && err == 0; i++) {
>> -struct usb_reques
On Fri, Jul 08 2016, Baolin Wang wrote:
> On 7 July 2016 at 20:51, Michal Nazarewicz wrote:
>> On Thu, Jul 07 2016, Baolin Wang wrote:
>>> Some gadget device (such as dwc3 gadget) requires quirk_ep_out_aligned_size
>>> attribute, which means it need to align the reque
it is need to align
> the request buffer's size to an ep's maxpacketsize.
>
> Signed-off-by: Baolin Wang
Acked-by: Michal Nazarewicz
> ---
> drivers/usb/gadget/function/f_midi.c | 18 +++---
> 1 file changed, 11 insertions(+), 7 deletions(-)
>
On Fri, Jun 24 2016, Dan Carpenter wrote:
> Return -ENOMEM if kmalloc() fails.
>
> Fixes: 9353afbbfa7b ('usb: gadget: f_fs: buffer data from ‘oversized’ OUT
> requests')
> Signed-off-by: Dan Carpenter
>
Acked-by: Michal Nazarewicz
> diff --git a/drivers/usb/gadg
doing so, it removes calls to ioread32 function which does I/O with
the device, but I hope the reads don’t have any side effects that are
needed.
Signed-off-by: Michal Nazarewicz
---
drivers/usb/gadget/udc/mv_u3d_core.c | 23 +++
1 file changed, 3 insertions(+), 20 deletions
that
are needed.
Signed-off-by: Michal Nazarewicz
---
drivers/usb/gadget/udc/r8a66597-udc.c | 24 ++--
1 file changed, 6 insertions(+), 18 deletions(-)
diff --git a/drivers/usb/gadget/udc/r8a66597-udc.c
b/drivers/usb/gadget/udc/r8a66597-udc.c
index 8b300e6..f2c8862 100644
--- a
needed.
Signed-off-by: Michal Nazarewicz
---
drivers/usb/gadget/udc/m66592-udc.c | 24 ++--
1 file changed, 6 insertions(+), 18 deletions(-)
diff --git a/drivers/usb/gadget/udc/m66592-udc.c
b/drivers/usb/gadget/udc/m66592-udc.c
index b1cfa96..6e977dc 100644
--- a/drivers/usb
On Tue, May 31 2016, Felipe Balbi wrote:
> This series doesn't seem to apply to v4.7-rc1. Care to rebase on
> testing/fixes?
Sure. Only the first patch needs fixing (by skipping failed hunks).
Michal Nazarewicz (4):
usb: gadget: fix unused-but-set-variale warnings
usb: gadget:
Those are enabled with W=1 make option.
The patch leaves of some type-limits warnings which are caused by
generic macros used in a way where they produce always-false
conditions.
Signed-off-by: Michal Nazarewicz
---
drivers/usb/gadget/function/f_fs.c | 3 +--
drivers/usb/gadget/function
On Sat, May 28 2016, Dan Carpenter wrote:
> Try compiling the code you suggested.
I find this amusing to be perfectly honest.
Kernel uses designated initialisers, flexible array members, stdint.h,
compound literals and variadic macros, yet still for some reason sticks
to -std=gnu89.
No matter, t
: ddf8abd25994 ('USB: f_fs: the FunctionFS driver')
> Signed-off-by: Dan Carpenter
Acked-by: Michal Nazarewicz
> ---
> v2: move the eps_ptr assignment outside the loop.
>
> diff --git a/drivers/usb/gadget/function/f_fs.c
> b/drivers/usb/gadget/function/f_fs.c
> index 7351
On Sat, May 28 2016, Dan Carpenter wrote:
> Also in the kernel we have to declare variables at the start of the
> block.
/me shrugs
I looked at this out of curiosity and there are precedents:
$ git grep 'for (\(int\|unsigned\|signed\|long\|char\)[[:space:]]' |wc -l
19
(albeit mostly in
is the wrong variable to use for an iterator.
>
> Fixes: ddf8abd25994 ('USB: f_fs: the FunctionFS driver')
> Signed-off-by: Dan Carpenter
Acked-by: Michal Nazarewicz
How on Earth could I have made that mistake is beyond my
comprehension. O_o On second thought, things being
);
^
Signed-off-by: Michal Nazarewicz
---
drivers/usb/gadget/function/f_fs.c | 3 +-
drivers/usb/gadget/function/u_serial.c | 3 +-
drivers/usb/gadget/legacy/g_ffs.c | 15 --
drivers/usb/gadget/udc/amd5536udc.c| 9 +-
drivers/usb/gadget/udc/bdc/bdc_cmd.c | 3 --
needed.
Signed-off-by: Michal Nazarewicz
Cc: Yoshihiro Shimoda
---
drivers/usb/gadget/udc/m66592-udc.c | 24 ++--
1 file changed, 6 insertions(+), 18 deletions(-)
diff --git a/drivers/usb/gadget/udc/m66592-udc.c
b/drivers/usb/gadget/udc/m66592-udc.c
index b1cfa96..6e977dc
that
are needed.
Signed-off-by: Michal Nazarewicz
Cc: Yoshihiro Shimoda
---
drivers/usb/gadget/udc/r8a66597-udc.c | 24 ++--
1 file changed, 6 insertions(+), 18 deletions(-)
diff --git a/drivers/usb/gadget/udc/r8a66597-udc.c
b/drivers/usb/gadget/udc/r8a66597-udc.c
index
doing so, it removes calls to ioread32 function which does I/O with
the device, but I hope the reads don’t have any side effects that are
needed.
Signed-off-by: Michal Nazarewicz
Cc: Yu Xu
---
drivers/usb/gadget/udc/mv_u3d_core.c | 23 +++
1 file changed, 3 insertions(+), 20
Fixes all of the unused-but-set-variable warnings enabled when
building with W=1. As described in the first patch, some warnings are
left off. See said patch for more description.
Michal Nazarewicz (4):
usb: gadget: fix unused-but-set-variale warnings
usb: gadget: m66592: fix unused-but-set
UDC does and
* breaks one read -> one request model which has been true so far.
Michal Nazarewicz (2):
usb: gadget: f_fs: printk error when excess data is dropped on read
usb: gadget: f_fs: buffer data from ‘oversized’ OUT requests
drivers/usb/gadget/function/f_fs.c |
ignored.
Signed-off-by: Michal Nazarewicz
---
drivers/usb/gadget/function/f_fs.c | 130 +++--
1 file changed, 109 insertions(+), 21 deletions(-)
diff --git a/drivers/usb/gadget/function/f_fs.c
b/drivers/usb/gadget/function/f_fs.c
index e26a6b4..08a1ac2 100644
Add a pr_err when host sent more data then the size of the buffer user
space gave us. This may happen on UDCs which require OUT requests to
be aligned to max packet size. The patch includes a description of the
situation.
Signed-off-by: Michal Nazarewicz
---
drivers/usb/gadget/function/f_fs.c
On Thu, May 19 2016, Changbin Du wrote:
>> 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
>> > th
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
On Tue, May 17 2016, Changbin Du wrote:
>> There appears to be no kfifo support for iov_iter though, so I just went
>> with a simple buffer.
>>
>> I haven’t looked at the patch too carefully so this is an RFC rather
>> than an actual patch at this point. It does compile at least.
>>
>> Regardles
On Mon, May 16 2016, Felipe Balbi wrote:
> Michal Nazarewicz writes:
>
>>> Alan Stern writes:
>>>> The point is that you don't know whether the host sent more data than
>>>> expected. All you know is that the host sent more data than the user
>
> On 05/16/2016 06:05 PM, Michal Nazarewicz wrote:
>> So I’ve been looking at AIO handling in f_fs and either I’m stupid or
>> the code is broken.
On Mon, May 16 2016, Lars-Peter Clausen wrote:
> The code was broken. Fixed in commit 332a5b446b791 ("usb: gadget:
> f_fs:
So I’ve been looking at AIO handling in f_fs and either I’m stupid or
the code is broken. Here’s part of ffs_user_copy_worker:
int ret = io_data->req->status ? io_data->req->status :
io_data->req->actual;
if (io_data->read && ret > 0) {
> Alan Stern writes:
>> The point is that you don't know whether the host sent more data than
>> expected. All you know is that the host sent more data than the user
>> asked the kernel for -- but maybe the user didn't ask for all the
>> data that he expected. Maybe the user wanted to retrieve t
On Fri, May 13 2016, Alan Stern wrote:
> The point is that you don't know whether the host sent more data than
> expected. All you know is that the host sent more data than the user
> asked the kernel for -- but maybe the user didn't ask for all the data
> that he expected. Maybe the user wanted
On Wed, May 11 2016, Felipe Balbi wrote:
> Also, returning -EOVERFLOW is not exactly correct here, because you'd
> violate POSIX specification of read(), right ?
Maybe we could piggyback on:
EINVAL fd was created via a call to timerfd_create(2) and the
wrong size buffer was g
_fs: add aio support")
> Signed-off-by: Lars-Peter Clausen
And obviously, moments after I sent an email asking a question I tracked
down ki_complete. The commit message could benefit from being more
detailed regardless.
Acked-by: Michal Nazarewicz
This probably also deserves
Cc: # 3.14+
On Thu, Apr 14 2016, Lars-Peter Clausen wrote:
> Calling the ki_complete() callback will free the underlying data structure.
> Make sure that it is no longer accessed beyond that point, otherwise
> undefined behaviour might occur.
To be honest I have trouble tracking what ki_complete is. Could yo
On Mon, Apr 18 2016, Andrzej Pietrasiewicz wrote:
> The function responsible for verifying if a symlink can be made is in
> drivers/usb/gadget/configfs.c: config_usb_cfg_link()
>
> There is a comment from the author:
>
>* Also a function instance can only be linked once.
>
> This is the cod
mistaken, configfs
gadget doesn’t even allow it to be expressed.
¹ I have no example failure though. Conclusion that legacy/multi has
a bug is based purely on me reading the code.
Signed-off-by: Michal Nazarewicz
Tested-by: Ivaylo Dimitrov
Cc: Alan Stern
Cc: sta...@vger.kernel.org
> On Thu, 7 Apr 2016, Michal Nazarewicz wrote:
>> This makes me suspect it’s not possible to link a function instance to
>> the same configuration twice, but now that I think about it, I’m not
>> quite sure what would happen if one did:
>>
>> ln -s functio
>> On Tue, Apr 05 2016, Alan Stern wrote:
>>> Suppose one usb_function is carrying out an I/O operation while
>>> another one in the same config gets a Set-Interface request from the
>>> host.
> On Wed, 6 Apr 2016, Michal Nazarewicz wrote:
>> That cannot
9b8639 ("gadget/function/f_fs.c: use put iov_iter into io_data")
> Signed-off-by: Lars-Peter Clausen
Acked-by: Michal Nazarewicz
(I thought I’ve already acked it).
> ---
> Changes since v1:
> * copy_to_iter() can fail, make sure that is handled. Test this c
On Tue, Apr 05 2016, Alan Stern wrote:
> Suppose one usb_function is carrying out an I/O operation while
> another one in the same config gets a Set-Interface request from the
> host.
That cannot happen. A single instance of mass_storage cannot¹ be added
twice to the same configuration.
¹ To be
> On Tue, 5 Apr 2016, Michal Nazarewicz wrote:
>> When binding the function to usb_configuration, check whether the thread
>> is running before starting another one. Without that, when function
>> instance is added to multiple configurations, fsg_bing starts multiple
>&g
need
to worry about starting the thread by themselves (which was where bug
in legacy/multi was in the first place).
¹ I have no example failure though. Conclusion that legacy/multi has
a bug is based purely on me reading the code.
Signed-off-by: Michal Nazarewicz
---
drivers/usb/gadget
On Fri, Apr 01 2016, Michal Nazarewicz wrote:
> For legacy/nokia setting no_configfs should be a valid solution:
>
> >8
> diff --git a/drivers/usb/gadget/legacy/nokia.c
> b/drivers/usb/gadget/legacy/nokia
> On 04/04/16 13:11, Michal Nazarewicz wrote:
>> Or maybe even this which gets away with gotos all together:
>>
>> diff --git a/drivers/usb/gadget/function/f_midi.c
>> b/drivers/usb/gadget/function/f_midi.c
>> index 56e2dde..91cae60 100644
>> --- a/driver
On Mon, Apr 04 2016, Ivaylo Dimitrov wrote:
> Who and when is going to destroy the thread if one does
> "/sys/bus/platform/drivers/musb-hdrc# echo musb-hdrc.0.auto > unbind"?
> Wouldn't some kind of refcounting make sense here?
Currently the thread is killed when fsg_common structure is released a
On Mon, Apr 04 2016, Alan Stern wrote:
> So there is no way to add a single function to several configurations?
There is. f_mass_storage (and any other usb_function_instance) simply
has to have multiple usb_function structures.
> It sounds like there are two problems then. The first problem is
On Sat, Apr 02 2016, Alan Stern wrote:
> On Sat, 2 Apr 2016, Michal Nazarewicz wrote:
>> At the same time, mass storage should work fine if it’s bound to
>> multiple configurations. Only one configuration can be active at any
>> given time so interfaces on different
On Sat, Apr 02 2016, Dan Carpenter wrote:
> We added some new locking here, but missed an error path where we need
> to unlock.
>
> Fixes: 9acdf4df2fc4 ('usb: gadget: f_midi: added spinlock on transmit
> function')
> Signed-off-by: Dan Carpenter
>
Acked-by: Micha
> On Fri, 1 Apr 2016, Michal Nazarewicz wrote:
>> @@ -3050,9 +3053,11 @@ static int fsg_bind(struct usb_configuration *c,
>> struct usb_function *f)
>> if (ret)
>> return ret;
>> fsg_common_set_inqui
On Thu, Mar 31 2016, Alan Stern wrote:
> Michal, I'm not sure how you intended to handle this.
For legacy/nokia setting no_configfs should be a valid solution:
>8
diff --git a/drivers/usb/gadget/legacy/nokia.c
b/drivers/usb/ga
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’oh. Of course. Disregard all my comments on the patch (except for
Ack).
--
PacketSize
> because that can cause bugs (this bug) or performance issues. Thus, this patch
> fixes this problem by eliminating buflen entirely and replacing it with
> wMaxPacketSize of the appropriate endpoint where needed.
>
> Signed-off-by: Felipe F. Tonello
Acked-by: Michal Nazarew
;s buffer size
> for the OUT endpoint as its wMaxPacketSize.
>
> Signed-off-by: Felipe F. Tonello
Acked-by: Michal Nazarewicz
But see comment below:
> ---
> drivers/usb/gadget/function/f_midi.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/dri
>> On Wed, Mar 02 2016, Felipe F. Tonello wrote:
>>> @@ -16,7 +16,7 @@
>>> * Copyright (C) 2006 Thumtronics Pty Ltd.
>>> * Ben Williamson
>>> *
>>> - * Licensed under the GPL-2 or later.
>>> + * Licensed under the GPLv2.
1 - 100 of 552 matches
Mail list logo