Re: usb: gadget: ffs: Fix BUG when userland exits with submitted AIO transfers

2018-10-23 Thread Lars-Peter Clausen
On 06/29/2018 08:32 AM, Felipe Balbi wrote: > > Hi, > > Alan Stern writes: >> On Thu, 21 Jun 2018, Roger Quadros wrote: >> > Can we avoid the spin_lock() and the work-queue and call usb_ep_dequeue() > directly from here? >> What is the purpose of the spin_lock()? I agree

Re: usb: gadget: ffs: Fix BUG when userland exits with submitted AIO transfers

2018-10-23 Thread Lars-Peter Clausen
On 09/25/2018 02:46 PM, Vincent Pelletier wrote: > Hello, > > On Thu, 2 Aug 2018 14:23:51 +, Vincent Pelletier > wrote: >> On Thu, 2 Aug 2018 00:45:14 +, "He, Bo" wrote: >>> Your patch fix the issue BUG: scheduling while atomic: >> >> Yes, although from my understanding of Felipe's

Re: usb: gadget: ffs: Fix BUG when userland exits with submitted AIO transfers

2018-06-21 Thread Lars-Peter Clausen
On 06/21/2018 10:29 AM, Roger Quadros wrote: [...] >>> static int ffs_aio_cancel(struct kiocb *kiocb) >>> { >>> struct ffs_io_data *io_data = kiocb->private; >>> - struct ffs_epfile *epfile = kiocb->ki_filp->private_data; >>> + struct ffs_data *ffs = io_data->ffs; >>>

Re: [GIT PULL] USB/PHY driver patches for 4.17-rc1

2018-04-05 Thread Lars-Peter Clausen
On 04/05/2018 08:31 AM, Kees Cook wrote: > On Wed, Apr 4, 2018 at 3:31 AM, Greg KH <gre...@linuxfoundation.org> wrote: >> Lars-Peter Clausen (2): >> usb: gadget: ffs: Execute copy_to_user() with USER_DS set > > https://git.kernel.org/linus/4058ebf33cb0be88ca516f96

Re: [PATCH] usb: gadget: ffs: Let setup() return USB_GADGET_DELAYED_STATUS

2018-01-12 Thread Lars-Peter Clausen
On 01/12/2018 01:01 PM, Felipe Balbi wrote: This fixed random occasional failures that were previously observed on a DWC3 based system under high system load. >>> >>> I need to see tracepoint capture from the failure ;-) Care to send them >>> to me for analysis? >> >> I've attached the

Re: [PATCH] usb: gadget: ffs: Let setup() return USB_GADGET_DELAYED_STATUS

2018-01-12 Thread Lars-Peter Clausen
On 01/12/2018 12:26 PM, Felipe Balbi wrote: > > Hi, > > Lars-Peter Clausen <l...@metafoo.de> writes: >> Some UDC drivers (like the DWC3) expect that the response to a setup() > > not some, but *all*. You can only queue a response later IFF you return > USB_GADGE

[PATCH] usb: gadget: ffs: Let setup() return USB_GADGET_DELAYED_STATUS

2018-01-12 Thread Lars-Peter Clausen
previously observed on a DWC3 based system under high system load. Signed-off-by: Lars-Peter Clausen <l...@metafoo.de> --- 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/

[PATCH] usb: gadget: ffs: Execute copy_to_user() with USER_DS set

2018-01-12 Thread Lars-Peter Clausen
is analogous to commit d7ffde35e31a ("vhost: use USER_DS in vhost_worker thread") which addresses the same underlying issue. Signed-off-by: Lars-Peter Clausen <l...@metafoo.de> --- drivers/usb/gadget/function/f_fs.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/usb

Re: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-16 Thread Lars-Peter Clausen
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. The code was broken. Fixed in commit 332a5b446b791 ("usb: gadget: f_fs: Fix EFAULT generation for async read operations:). -- To unsubscribe from this

Re: [PATCH] usb: gadget: f_fs: Fix kernel panic for SuperSpeed

2016-04-22 Thread Lars-Peter Clausen
On 04/22/2016 12:43 PM, Jim Lin wrote: > Android N adds os_desc_compat in v2_descriptor by init_functionfs() > (system/core/adb/usb_linux_client.cpp) to support automatic install > of MTP driver on Windows for USB device mode. > > Current __ffs_data_do_os_desc() of f_fs.c will check reserved1

[PATCH v2] usb: gadget: f_fs: Fix use-after-free when completing AIO request

2016-04-19 Thread Lars-Peter Clausen
is no longer accessed beyond that point, otherwise undefined behaviour might occur. Fixes: 2e4c7553cd6f ("usb: gadget: f_fs: add aio support") (for v3.19 and earlier drop the eventfd part) Signed-off-by: Lars-Peter Clausen <l...@metafoo.de> --- Changes since v1: * More verbos

Re: [PATCH] usb: gadget: f_fs: Fix use-after-free

2016-04-19 Thread Lars-Peter Clausen
On 04/19/2016 05:34 PM, Michal Nazarewicz wrote: > 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 mig

Re: [PATCH] usb: gadget: f_fs: Fix use-after-free

2016-04-19 Thread Lars-Peter Clausen
On 04/19/2016 05:29 PM, Michal Nazarewicz wrote: > 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

[PATCH] usb: gadget: f_fs: Fix use-after-free

2016-04-14 Thread Lars-Peter Clausen
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. Fixes: 2e4c7553cd6f ("usb: gadget: f_fs: add aio support") Signed-off-by: Lars-Peter Clausen <l.

[PATCH] usb: gadget: f_fs: Fix EFAULT generation for async read operations

2016-03-30 Thread Lars-Peter Clausen
d. Commit 342f39a6c8d3 ("usb: gadget: f_fs: fix check in read operation") already fixed the same problem for the synchronous read path. Fixes: c993c39b8639 ("gadget/function/f_fs.c: use put iov_iter into io_data") Signed-off-by: Lars-Peter Clausen <l...

Re: [PATCH] usb: gadget: f_fs: Fix incorrect EFAULT generation for async read operations

2016-03-28 Thread Lars-Peter Clausen
On 03/28/2016 04:28 PM, Al Viro wrote: > On Mon, Mar 28, 2016 at 02:42:43PM +0200, Lars-Peter Clausen wrote: >> In the current implementation functionfs generates a EFAULT for async read >> operations if the read buffer size is larger than the URB data size. Since >&g

[PATCH] usb: gadget: f_fs: Fix incorrect EFAULT generation for async read operations

2016-03-28 Thread Lars-Peter Clausen
us read path. Fixes: c993c39b8639 ("gadget/function/f_fs.c: use put iov_iter into io_data") Signed-off-by: Lars-Peter Clausen <l...@metafoo.de> --- drivers/usb/gadget/function/f_fs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_fs.c b/driv

Re: [PATCH] uwb: Remove umc bus legacy suspend/resume support

2015-04-03 Thread Lars-Peter Clausen
On 04/03/2015 03:44 PM, Greg Kroah-Hartman wrote: On Sun, Mar 15, 2015 at 06:03:00PM +0100, Lars-Peter Clausen wrote: There are currently no umc drivers implementing suspend/resume, so remove the legacy suspend/resume support from the framework. If a umc driver ever wants to implement suspend

[PATCH] uwb: Remove umc bus legacy suspend/resume support

2015-03-15 Thread Lars-Peter Clausen
. Signed-off-by: Lars-Peter Clausen l...@metafoo.de --- drivers/uwb/umc-bus.c | 34 -- include/linux/uwb/umc.h | 2 -- 2 files changed, 36 deletions(-) diff --git a/drivers/uwb/umc-bus.c b/drivers/uwb/umc-bus.c index 88a290f..c857140 100644 --- a/drivers/uwb/umc

Re: [PATCH_V4 1/3] dt: usb: jz4740: Add DT binding document for OHCI

2015-02-03 Thread Lars-Peter Clausen
On 02/03/2015 11:53 AM, Zubair Lutfullah Kakakhel wrote: On 03/02/15 10:32, Lars-Peter Clausen wrote: On 02/03/2015 11:17 AM, Zubair Lutfullah Kakakhel wrote: [...] V4 Changes Removed clock binding because of pending work in clock tree. Will add binding later. Rather than introduce a bad

Re: [PATCH_V4 1/3] dt: usb: jz4740: Add DT binding document for OHCI

2015-02-03 Thread Lars-Peter Clausen
On 02/03/2015 11:17 AM, Zubair Lutfullah Kakakhel wrote: [...] V4 Changes Removed clock binding because of pending work in clock tree. Will add binding later. Rather than introduce a bad binding now and change later. But this patch is introducing a bad binding. The part needs the clock to

Re: [PATCH 5/8] usb: musb: Change end point selection to use new IO access

2014-11-25 Thread Lars-Peter Clausen
On 11/25/2014 12:52 AM, Tony Lindgren wrote: * Apelete Seketeli apel...@seketeli.net [141124 15:40]: Hi Tony, Thanks for the patch. On Mon, Nov-24-2014 at 11:05:03 AM -0800, Tony Lindgren wrote: This allows the endpoints to work when multiple MUSB glue layers are built in. Applied on top

Re: [PATCH v3 1/2] usb: musb: add support for JZ4740 usb device controller

2014-01-04 Thread Lars-Peter Clausen
later, but Lars-Peter Clausen did experiment with DMA, and found out that all ethernet packets were unaligned, while the DMA only works if they are aligned. As a consequence, the DMA was bypassed all the time, making it useless at least for the ethernet gadget we are interested in. That's why DMA

Re: [PATCH 15/16] dmaengine: add transfered member to dma_async_tx_descriptor

2013-07-25 Thread Lars-Peter Clausen
On 07/22/2013 08:10 PM, Sebastian Andrzej Siewior wrote: In USB RX path it is possible that the we receive less bytes than requested. Take the following example: The driver for USB-to-UART submits an URB with 256 bytes in size and the dmaengine driver in turn programs a transfer of 256 bytes.