Re: usb: dwc2: Re: Maximum packet size in dwc2 gadget HS mode < 1024

2019-10-11 Thread Minas Harutyunyan
Hi Pavel, On 10/11/2019 9:54 AM, Minas Harutyunyan wrote: > Hi Pavel, > > On 10/10/2019 8:36 PM, Pavel Hofman wrote: >> I forgot version information - branch 5.3 >> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_raspberrypi_linux_tree_rpi-2D5.3.y_drivers_usb_dwc2&d=DwICBA&c=DPL6_

[PATCH 2/2] USB: serial: ti_usb_3410_5052: clean up serial data access

2019-10-11 Thread Johan Hovold
Use the tdev pointer directly instead of going through the port data when accessing the serial data in open(). Signed-off-by: Johan Hovold --- drivers/usb/serial/ti_usb_3410_5052.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/dr

[PATCH 1/2] USB: serial: ti_usb_3410_5052: fix port-close races

2019-10-11 Thread Johan Hovold
Fix races between closing a port and opening or closing another port on the same device which could lead to a failure to start or stop the shared interrupt URB. The latter could potentially cause a use-after-free or worse in the completion handler on driver unbind. Fixes: 1da177e4c3f4 ("Linux-2.6.

Re: [PATCH 2/2] USB: serial: ti_usb_3410_5052: clean up serial data access

2019-10-11 Thread Johan Hovold
On Fri, Oct 11, 2019 at 11:57:36AM +0200, Johan Hovold wrote: > Use the tdev pointer directly instead of going through the port data > when accessing the serial data in open(). hmm, s/open/close/. > Signed-off-by: Johan Hovold > --- > drivers/usb/serial/ti_usb_3410_5052.c | 4 ++-- > 1 file cha

Re: [PATCH 00/14] usb: typec: UCSI driver overhaul

2019-10-11 Thread Heikki Krogerus
Hi, On Thu, Oct 10, 2019 at 05:51:23PM +, Ajay Gupta wrote: > Hi Heikki, > > > > > > Hi Ajay, > > > > > > > > > > Here's the pretty much complete rewrite of the I/O handling that I > > > > > was talking about. The first seven patches are not actually > > > > > related to this stuff, but I'm i

[PATCH v2] usb: usbfs: Suppress problematic bind and unbind uevents.

2019-10-11 Thread Ingo Rohloff
commit 1455cf8dbfd0 ("driver core: emit uevents when device is bound to a driver") added bind and unbind uevents when a driver is bound or unbound to a physical device. For USB devices which are handled via the generic usbfs layer (via libusb for example), this is problematic: Each time a user spa

Re: [PATCH 8/8] xhci: Fix NULL pointer dereference in xhci_clear_tt_buffer_complete()

2019-10-11 Thread Mathias Nyman
On 8.10.2019 11.15, Mathias Nyman wrote: On 7.10.2019 17.02, Johan Hovold wrote: I didn't have time to look into this myself last week, or comment on the patch before Greg picked it up, but this clearly isn't the right fix. As your comment suggests, ep->hcpriv may indeed be NULL here if USB co

[RFT PATCH] xhci: Fix use-after-free regression in xhci clear hub TT implementation

2019-10-11 Thread Mathias Nyman
commit ef513be0a905 ("usb: xhci: Add Clear_TT_Buffer") schedules work to clear TT buffer, but causes a use-after-free regression at the same time Make sure hub_tt_work finishes before endpoint is disabled, otherwise the work will dereference already freed endpoint and device related pointers. Thi

how to test g_webcam

2019-10-11 Thread Roger Quadros
Hi, I'm having a hard time to figure out how to get g_webcam working with the tip of http://git.ideasonboard.org/uvc-gadget.git Platform I'm using is dra7-evm with dwc3 controller. At first things just lock up the moment I load g_webcam. To fix the deadlock drivers/us

Re: how to test g_webcam

2019-10-11 Thread Felipe Balbi
Hi, Roger Quadros writes: > Hi, > > I'm having a hard time to figure out how to get g_webcam working with > the tip of http://git.ideasonboard.org/uvc-gadget.git > > Platform I'm using is dra7-evm with dwc3 controller. which arguments are you passing to g_webcam? > What platform was g_webca

[PATCH] USB: legousbtower: fix a signedness bug in tower_probe()

2019-10-11 Thread Dan Carpenter
The problem is that sizeof() is unsigned long so negative error codes are type promoted to high positive values and the condition becomes false. Fixes: 1d427be4a39d ("USB: legousbtower: fix slab info leak at probe") Signed-off-by: Dan Carpenter --- drivers/usb/misc/legousbtower.c | 2 +- 1 file

[PATCH] usb: typec: fix an IS_ERR() vs NULL bug in hd3ss3220_probe()

2019-10-11 Thread Dan Carpenter
The device_get_named_child_node() function doesn't return error pointers, it returns NULL on error. Fixes: 1c48c759ef4b ("usb: typec: driver for TI HD3SS3220 USB Type-C DRP port controller") Signed-off-by: Dan Carpenter --- drivers/usb/typec/hd3ss3220.c | 4 ++-- 1 file changed, 2 insertions(+)

Re: [PATCH] USB: legousbtower: fix a signedness bug in tower_probe()

2019-10-11 Thread walter harms
Am 11.10.2019 15:35, schrieb Dan Carpenter: > The problem is that sizeof() is unsigned long so negative error codes > are type promoted to high positive values and the condition becomes > false. > > Fixes: 1d427be4a39d ("USB: legousbtower: fix slab info leak at probe") > Signed-off-by: Dan Carp

Re: [PATCH] USB: legousbtower: fix a signedness bug in tower_probe()

2019-10-11 Thread Dan Carpenter
On Fri, Oct 11, 2019 at 03:51:26PM +0200, walter harms wrote: > > > Am 11.10.2019 15:35, schrieb Dan Carpenter: > > The problem is that sizeof() is unsigned long so negative error codes > > are type promoted to high positive values and the condition becomes > > false. > > > > Fixes: 1d427be4a39d

Re: [PATCH] usb: typec: fix an IS_ERR() vs NULL bug in hd3ss3220_probe()

2019-10-11 Thread Heikki Krogerus
On Fri, Oct 11, 2019 at 04:35:58PM +0300, Dan Carpenter wrote: > The device_get_named_child_node() function doesn't return error > pointers, it returns NULL on error. > > Fixes: 1c48c759ef4b ("usb: typec: driver for TI HD3SS3220 USB Type-C DRP port > controller") > Signed-off-by: Dan Carpenter >

Re: [PATCH] USB: legousbtower: fix a signedness bug in tower_probe()

2019-10-11 Thread Johan Hovold
On Fri, Oct 11, 2019 at 04:35:25PM +0300, Dan Carpenter wrote: > The problem is that sizeof() is unsigned long so negative error codes > are type promoted to high positive values and the condition becomes > false. > > Fixes: 1d427be4a39d ("USB: legousbtower: fix slab info leak at probe") > Signed-

Re: [PATCH] USB: legousbtower: fix a signedness bug in tower_probe()

2019-10-11 Thread Johan Hovold
On Fri, Oct 11, 2019 at 04:58:56PM +0300, Dan Carpenter wrote: > On Fri, Oct 11, 2019 at 03:51:26PM +0200, walter harms wrote: > > > > > > Am 11.10.2019 15:35, schrieb Dan Carpenter: > > > The problem is that sizeof() is unsigned long so negative error codes > > > are type promoted to high positi

[PATCH v2] USB: legousbtower: fix a signedness bug in tower_probe()

2019-10-11 Thread Dan Carpenter
The problem is that sizeof() is unsigned long so negative error codes are type promoted to high positive values and the condition becomes false. Fixes: 1d427be4a39d ("USB: legousbtower: fix slab info leak at probe") Signed-off-by: Dan Carpenter --- v2: style improvement suggested by Walter Harms.

Re: [PATCH v2] USB: legousbtower: fix a signedness bug in tower_probe()

2019-10-11 Thread Johan Hovold
On Fri, Oct 11, 2019 at 05:11:15PM +0300, Dan Carpenter wrote: > The problem is that sizeof() is unsigned long so negative error codes > are type promoted to high positive values and the condition becomes > false. > > Fixes: 1d427be4a39d ("USB: legousbtower: fix slab info leak at probe") > Signed-

[PATCH v4 9/9] usb: typec: Remove unused members from struct typec_capability

2019-10-11 Thread Heikki Krogerus
The members for the muxes are not used, so dropping them. Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck --- include/linux/usb/typec.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h index 894798084319..0f52723a11bd 100644 --

[PATCH v4 0/9] usb: typec: Small API improvement

2019-10-11 Thread Heikki Krogerus
Hi, I'm sending one more version of these patches to you before sending them to Greg. There are still some fixes coming that will conflict with patches in this series. Since I'm not in any hurry with these, I'll wait for those fixes in this case. The only change in this version is that I'm now ch

[PATCH v4 6/9] usb: typec: ucsi: Start using struct typec_operations

2019-10-11 Thread Heikki Krogerus
Supplying the operation callbacks as part of a struct typec_operations instead of as part of struct typec_capability during port registration. Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck --- drivers/usb/typec/ucsi/ucsi.c | 22 +++--- 1 file changed, 11 insertions(+

[PATCH v4 8/9] usb: typec: Remove the callback members from struct typec_capability

2019-10-11 Thread Heikki Krogerus
There are no more users for them. Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck --- drivers/usb/typec/class.c | 40 +++ include/linux/usb/typec.h | 17 - 2 files changed, 11 insertions(+), 46 deletions(-) diff --git a/drivers/usb/

[PATCH v4 5/9] usb: typec: tps6598x: Start using struct typec_operations

2019-10-11 Thread Heikki Krogerus
Supplying the operation callbacks as part of a struct typec_operations instead of as part of struct typec_capability during port registration. After this there is not need to keep the capabilities stored anywhere in the driver. Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck --- drive

[PATCH v4 4/9] usb: typec: tcpm: Start using struct typec_operations

2019-10-11 Thread Heikki Krogerus
Supplying the operation callbacks as part of a struct typec_operations instead of as part of struct typec_capability during port registration. Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck --- drivers/usb/typec/tcpm/tcpm.c | 45 --- 1 file changed, 20

[PATCH v4 1/9] usb: typec: Copy everything from struct typec_capability during registration

2019-10-11 Thread Heikki Krogerus
Copying everything from struct typec_capability to struct typec_port during port registration. This will make sure that under no circumstances the driver can change the values in the struct typec_capability that the port uses. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/class.c | 20 +++

[PATCH v4 7/9] usb: typec: hd3ss3220: Start using struct typec_operations

2019-10-11 Thread Heikki Krogerus
Supplying the operation callbacks as part of a struct typec_operations instead of as part of struct typec_capability during port registration. After this there is not need to keep the capabilities stored anywhere in the driver. Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck --- drive

[PATCH v4 3/9] usb: typec: Separate the operations vector

2019-10-11 Thread Heikki Krogerus
Introducing struct typec_operations which has the same callbacks as struct typec_capability. The old callbacks are kept for now, but after all users have been converted, they will be removed. Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck --- drivers/usb/typec/class.c | 39 ++

[PATCH v4 2/9] usb: typec: Introduce typec_get_drvdata()

2019-10-11 Thread Heikki Krogerus
Leaving the private driver_data pointer of the port device to the port drivers. Signed-off-by: Heikki Krogerus Reviewed-by: Guenter Roeck --- drivers/usb/typec/class.c | 11 +++ include/linux/usb/typec.h | 4 2 files changed, 15 insertions(+) diff --git a/drivers/usb/typec/class.

Re: [PATCH v4 1/9] usb: typec: Copy everything from struct typec_capability during registration

2019-10-11 Thread Guenter Roeck
On Fri, Oct 11, 2019 at 06:32:11PM +0300, Heikki Krogerus wrote: > Copying everything from struct typec_capability to struct > typec_port during port registration. This will make sure > that under no circumstances the driver can change the values > in the struct typec_capability that the port uses.

[PATCH v2] usb: typec: fix an IS_ERR() vs NULL bug in hd3ss3220_probe()

2019-10-11 Thread Dan Carpenter
The device_get_named_child_node() function doesn't return error pointers, it returns NULL on error. Fixes: 1c48c759ef4b ("usb: typec: driver for TI HD3SS3220 USB Type-C DRP port controller") Signed-off-by: Dan Carpenter --- v2: remove -ENODEV instead of -EIO drivers/usb/typec/hd3ss3220.c | 4 +