Re: Re: [PATCH 2/3] usb: gadget: composite: ability for USB functions to process control requests in config 0

2016-06-22 Thread Felix Hädicke
Hello, > Hi, > > Felix Hädicke <felixhaedi...@web.de> writes: > > It can sometimes be necessary for gadget drivers to process non-standard > > control requests, which host devices can send without having sent > > USB_REQ_SET_CONFIGURATION. > > got an exa

Re: Re: [PATCH 1/3] usb: gadget: f_fs: handle control requests not directed to interface or endpoint

2016-06-22 Thread Felix Hädicke
Hello, > Hi, > > Felix Hädicke <felixhaedi...@web.de> writes: > > Introduces a new FunctionFS descriptor flag named > > FUNCTIONFS_ALL_CTRL_RECIP. When this flag is enabled, control requests, > > which are not explicitly directed to an interfac

Re: Re: [PATCH 1/3] usb: gadget: f_fs: handle control requests not directed to interface or endpoint

2016-06-22 Thread Felix Hädicke
> This is actually not for a f_accessory replacement. The control requests are > sent when the device is in any other gadget mode, for sending metadata and to > trigger switching to Open Accessory Gadget Mode. > > The Accessory mode itself can be handled very easily with f_serial (or a very >

Re: Re: [PATCH 1/3] usb: gadget: f_fs: handle control requests not directed to interface or endpoint

2016-06-22 Thread Felix Hädicke
Hello, > > I am developing a driver, which I would like to implement using > > FunctionFS, for using the Android Open Accessory protocol on > > non-Android devices. These accessories send some non-standard control > > requests which are described here: > >

[PATCH 3/3] usb: gadget: f_fs: handle control requests in config 0

2016-06-21 Thread Felix Hädicke
Introduces a new FunctionFS descriptor flag named FUNCTIONFS_CONFIG0_SETUP. When this flag is enabled, FunctionFS userspace drivers can process non-standard control requests in configuration 0. Signed-off-by: Felix Hädicke <felixhaedi...@web.de> --- drivers/usb/gadget/function/f_fs.

[PATCH 1/3] usb: gadget: f_fs: handle control requests not directed to interface or endpoint

2016-06-21 Thread Felix Hädicke
-by: Felix Hädicke <felixhaedi...@web.de> --- drivers/usb/gadget/function/f_fs.c | 34 ++ include/uapi/linux/usb/functionfs.h | 1 + 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/fu

[PATCH 2/3] usb: gadget: composite: ability for USB functions to process control requests in config 0

2016-06-21 Thread Felix Hädicke
the first usb_function instance whose req_match() returns true. Signed-off-by: Felix Hädicke <felixhaedi...@web.de> --- drivers/usb/gadget/composite.c | 16 ++-- drivers/usb/gadget/function/f_fs.c | 9 +++-- drivers/usb/gadget/function/f_printer.c | 6 +

Re: [bug report] usb: gadget: f_fs: handle control requests not directed to interface or endpoint

2016-10-19 Thread Felix Hädicke
Hello Dan Carpenter, thanks for this. It is indeed a parentheses error. I am currently testing a patch to correct this. Regards, Felix > Hello Felix Hädicke, > > The patch 54dfce6d07b0: "usb: gadget: f_fs: handle control requests > not directed to interface or endpoint" fr

[PATCH 2/2] usb: gadget: serial: fix possible Oops caused by calling kthread_stop(NULL)

2016-11-16 Thread Felix Hädicke
Add check for NULL before calling kthread_stop(). There were cases in which gserial_console_exit() was called, but the console thread was not started. This resulted in an invalid kthread_stop(NULL) call. Signed-off-by: Felix Hädicke <felixhaedi...@web.de> --- drivers/usb/gadget/fu

[PATCH 1/2] usb: gadget: serial: zero-initialize struct variable gscons_info

2016-11-16 Thread Felix Hädicke
There can be cases when members of the gscons_info struct are used uninitialized, e. g. in, gserial_console_exit(), if gs_console_setup() was not called before. Signed-off-by: Felix Hädicke <felixhaedi...@web.de> --- drivers/usb/gadget/function/u_serial.c | 2 +- 1 file changed, 1 ins

Re: PROBLEM: Oops when deactivating gadget serial driver

2016-11-16 Thread Felix Hädicke
Hi, For me, it is always reproducible when CONFIG_U_SERIAL_CONSOLE is enabled. But I think that GDB is misleading, it has probably nothing to do with gs_buf_free(). For me, it looks like the real problem is that in gserial_console_exit(), kthread_stop() is called on the (in my case)

Re: [PATCH 1/2] usb: gadget: serial: zero-initialize struct variable gscons_info

2016-11-16 Thread Felix Hädicke
ok, thanks for the hint. I dind't know this. Just ignore this patch. Am 16.11.2016 um 22:42 schrieb Sergei Shtylyov: > Hello. > > On 11/16/2016 11:46 PM, Felix Hädicke wrote: > >> There can be cases when members of the gscons_info struct are used >> uninitialized, e. g.

[PATCH v2] usb: gadget: serial: fix possible Oops caused by calling kthread_stop(NULL)

2016-11-17 Thread Felix Hädicke
---[ end trace 5b3336a407e1698c ]--- Signed-off-by: Felix Hädicke <felixhaedi...@web.de> Tested-by: Peter Chen <peter.c...@nxp.com> --- Changes in v2: - Add Tested-by: Peter Chen - Add oops dump drivers/usb/gadget/function/u_serial.c | 3 ++- 1 file changed, 2 insertions(+)

Re: [PATCH] usb: gadget: f_fs: fix wrong parenthesis in ffs_func_req_match()

2016-11-17 Thread Felix Hädicke
> This also fixes the following static checker warning: > drivers/usb/gadget/function/f_fs.c:3152 ffs_func_req_match() > warn: always true condition '(((creq->wIndex)) >= 0) => (0-u16max >= 0)' > > Reported-by: Dan Carpenter <dan.carpen...@oracle.com> > Signed-off-by: Fel

PROBLEM: Oops when deactivating gadget serial driver

2016-11-15 Thread Felix Hädicke
Hello, In 4.8.6 and 4.9-rc5, the gadget serial driver crashes during deinitialisation when compiled with CONFIG_U_SERIAL_CONSOLE. Steps to reproduce: modprobe g-serial rmmod g-serial The problem also occurs when using configfs, when the UDC is unbound. I does not make a difference if I use my

[PATCH] usb: gadget: f_fs: fix wrong parenthesis in ffs_func_req_match()

2016-11-03 Thread Felix Hädicke
warning: drivers/usb/gadget/function/f_fs.c:3152 ffs_func_req_match() warn: always true condition '(((creq->wIndex)) >= 0) => (0-u16max >= 0)' Reported-by: Dan Carpenter <dan.carpen...@oracle.com> Signed-off-by: Felix Hädicke <felixhaedi...@web.de> --- drivers/usb/ga

PROBLEM: Oops when

2016-11-29 Thread Felix Hädicke
Hello, in 4.8.11 and 4.9-rc7, I get an Oops (see below), when I try to activate and afterward deactivate a second gadget configfs configuration, like this: mkdir /sys/kernel/config/usb_gadget/acm cd /sys/kernel/config/usb_gadget/acm echo 0x0200 > bcdUSB echo 0x0525 > idVendor echo 0xa4a7 >

PROBLEM: Oops when unbinding an inactive gadget configfs configuration from UDC

2016-11-29 Thread Felix Hädicke
Hello, in 4.8.11 and 4.9-rc7, I get an Oops (see below), when I try to activate and afterward deactivate a second gadget configfs configuration, like this: mkdir /sys/kernel/config/usb_gadget/acm cd /sys/kernel/config/usb_gadget/acm echo 0x0200 > bcdUSB echo 0x0525 > idVendor echo 0xa4a7 >

Re: usb/gadget: GPF in usb_gadget_unregister_driver

2016-12-03 Thread Felix Hädicke
Hi, > Hi! > > I've got the following error report while running the syzkaller fuzzer. > > On commit 3c49de52d5647cda8b42c4255cf8a29d1e22eff5 (Dec 2). > > general protection fault: [#1] SMP KASAN > Dumping ftrace buffer: >(ftrace buffer empty) > Modules linked in: > CPU: 0 PID: 10564 Comm:

Aw: Re: [PATCH] usb: gadget: udc: core: fix return code of usb_gadget_probe_driver()

2016-12-03 Thread Felix Hädicke
Hi, > On 12/01/2016 10:44 PM, Felix Hädicke wrote: > > Hi, > > > >> Hi, > >> > >> Good catch but I have a few comments to commit message: > >> > >> On 12/01/2016 12:24 AM, Felix Hädicke wrote: > >>> This fixes a regre

Re: [PATCH] usb: gadget: udc: core: fix return code of usb_gadget_probe_driver()

2016-12-01 Thread Felix Hädicke
Hi, > Hi, > > Good catch but I have a few comments to commit message: > > On 12/01/2016 12:24 AM, Felix Hädicke wrote: >> This fixes a regression which was introduced by commit f1bddbb, by >> reverting a small fragment of commit 855ed04. >> > Not exactly

[PATCH] usb: gadget: udc: core: fix return code of usb_gadget_probe_driver()

2016-11-30 Thread Felix Hädicke
t; 8b 02 4c 39 c7 75 52 4c 8b 40 08 4c 39 c7 75 66 48 89 50 08 RIP [] __list_del_entry+0x29/0xc0 RSP CR2: 0000 ---[ end trace 99fc090ab3ff6cbc ]--- Signed-off-by: Felix Hädicke <felixhaedi...@web.de> --- drivers/usb/gadget/udc/core.c | 6 +- 1 file changed, 5 insertions(+

Re: PROBLEM: Oops when unbinding an inactive gadget configfs configuration from UDC

2016-11-30 Thread Felix Hädicke
Hello, > I had expected that writing "dummy_udc.0" to > /sys/kernel/config/usb_gadget/gser/UDC would fail, because the UDC is > already bound to another gadget configuration > (/sys/kernel/config/usb_gadget/acm/UDC). However, this doesn't give me > an error, but the ACM configuration remains

[PATCH v2] usb: gadget: udc: core: fix return code of usb_gadget_probe_driver()

2016-12-29 Thread Felix Hädicke
t; 8b 02 4c 39 c7 75 52 4c 8b 40 08 4c 39 c7 75 66 48 89 50 08 RIP [] __list_del_entry+0x29/0xc0 RSP CR2: ---[ end trace 99fc090ab3ff6cbc ]--- Fixes: f1bddbb ("usb: gadget: Fix binding to UDC via configfs interface") Signed-off-by: Felix Hädicke <felixhaedi...@web