[PATCH v3 0/2] usb: Check for DMA capable buffer sanity

2017-04-25 Thread Florian Fainelli
Changes in v3: - added check in usb_gadget_map_request_by_dev (Felipe), new patch - improved commit message description (Clemens) - added additiona checks for urb->setup_packet (Alan) Changes in v2: - moved the check from usb_start_wait_urb() to usb_hcd_map_urb_for_dma() Florian Fainelli (2):

[PATCH v3 1/2] usb: core: Check URB setup_packet and transfer_buffer sanity

2017-04-25 Thread Florian Fainelli
Update usb_hcd_map_urb_for_dma() to check for an URB's setup_packet and transfer_buffer sanity. We first check that urb->setup_packet is neither coming from vmalloc space nor is an on stack buffer, and if that's the case, produce a warning and return an error. For urb->transfer_buffer there is an

[PATCH v3 2/2] usb: udc: core: Error if req->buf is either from vmalloc or stack

2017-04-25 Thread Florian Fainelli
Check that req->buf is a valid DMA capable address, produce a warning and return an error if it's either coming from vmalloc space or is an on stack buffer. Signed-off-by: Florian Fainelli --- drivers/usb/gadget/udc/core.c | 9 + 1 file changed, 9 insertions(+)

Re: typec: tcpm/tcpci drivers acceptable for drivers/staging in v4.12 ?

2017-04-25 Thread Greg Kroah-Hartman
On Tue, Apr 25, 2017 at 10:54:02AM -0700, Guenter Roeck wrote: > On Tue, Apr 25, 2017 at 07:37:42PM +0200, Greg Kroah-Hartman wrote: > > On Tue, Apr 25, 2017 at 09:50:31AM -0700, Guenter Roeck wrote: > > > Hi Greg, > > > > > > would you be open to accepting the tcpm [1] and tcpci [2] drivers into

Re: [PATCH v2] usb: misc: legousbtower: Fix buffers on stack

2017-04-25 Thread Greg Kroah-Hartman
On Sat, Apr 22, 2017 at 07:24:37PM +0300, Maksim Salau wrote: > Allocate buffers on HEAP instead of STACK for local structures > that are to be received using usb_control_msg(). > > Signed-off-by: Maksim Salau > Tested-by: Alfredo Rafael Vicente Boix >

Re: [PATCH v3] usb: typec: Don't prevent using constant typec_mode_desc initializers

2017-04-25 Thread Greg KH
On Mon, Apr 24, 2017 at 08:52:31PM +0200, Mats Karrman wrote: > Signed-off-by: Mats Karrman I can not take patches without any changelog text at all. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to

Re: usb: dwc2: NMI watchdog: BUG: soft lockup - CPU#0 stuck for 146s

2017-04-25 Thread Stefan Wahren
> Stefan Wahren hat am 22. April 2017 um 22:50 > geschrieben: > > > Hi, > > > Eric Anholt hat am 20. April 2017 um 20:54 geschrieben: > > > > > > Stefan Wahren writes: > > > > > Hi, > > > > > >> Doug Anderson

Re: typec: tcpm/tcpci drivers acceptable for drivers/staging in v4.12 ?

2017-04-25 Thread Guenter Roeck
On Tue, Apr 25, 2017 at 07:37:42PM +0200, Greg Kroah-Hartman wrote: > On Tue, Apr 25, 2017 at 09:50:31AM -0700, Guenter Roeck wrote: > > Hi Greg, > > > > would you be open to accepting the tcpm [1] and tcpci [2] drivers into > > drivers/staging for v4.12 ? > > What's the rush? > It has been a

Re: typec: tcpm/tcpci drivers acceptable for drivers/staging in v4.12 ?

2017-04-25 Thread Greg Kroah-Hartman
On Tue, Apr 25, 2017 at 09:50:31AM -0700, Guenter Roeck wrote: > Hi Greg, > > would you be open to accepting the tcpm [1] and tcpci [2] drivers into > drivers/staging for v4.12 ? What's the rush? > The drivers are not ready for prime time, yet there is interest by others > to have them

Re: [PATCH V3 4/4] soc/tegra: pmc: Use the new reset APIs to manage reset controllers

2017-04-25 Thread Vivek Gautam
On Tue, Apr 25, 2017 at 4:41 PM, Jon Hunter wrote: > > On 25/04/17 12:06, Vivek Gautam wrote: >> On 04/25/2017 04:24 PM, Jon Hunter wrote: >>> On 25/04/17 11:33, Philipp Zabel wrote: On Tue, 2017-04-25 at 11:05 +0100, Jon Hunter wrote: > On 25/04/17 05:15, Vivek

Re: typec: tcpm/tcpci drivers acceptable for drivers/staging in v4.12 ?

2017-04-25 Thread Guenter Roeck
On Tue, Apr 25, 2017 at 08:02:54PM +0200, Greg Kroah-Hartman wrote: > On Tue, Apr 25, 2017 at 10:54:02AM -0700, Guenter Roeck wrote: > > On Tue, Apr 25, 2017 at 07:37:42PM +0200, Greg Kroah-Hartman wrote: > > > On Tue, Apr 25, 2017 at 09:50:31AM -0700, Guenter Roeck wrote: > > > > Hi Greg, > > > >

Re: Regression - Linux 4.9: ums_eneub6250 broken: transfer buffer not dma capable - Trace

2017-04-25 Thread Andreas Hartmann
On 04/24/2017 at 10:39 PM Alan Stern wrote: > On Sun, 23 Apr 2017, Andreas Hartmann wrote: > >> Am 23.04.2017 um 18:09 schrieb Alan Stern: >> I applied this new patch, too and attached the newly created debugs. But >> first of all: you are great! The loading of the SD card now works as >>

typec: tcpm/tcpci drivers acceptable for drivers/staging in v4.12 ?

2017-04-25 Thread Guenter Roeck
Hi Greg, would you be open to accepting the tcpm [1] and tcpci [2] drivers into drivers/staging for v4.12 ? The drivers are not ready for prime time, yet there is interest by others to have them available and to help improving the code. I could create a repository/branch at github to enable

Re: [PATCH 1/5 v3] usb: host: add DT bindings for faraday fotg2

2017-04-25 Thread Hans Ulli Kroll
Hi Linus On Tue, 25 Apr 2017, Linus Walleij wrote: > On Mon, Apr 24, 2017 at 6:53 PM, Hans Ulli Kroll > wrote: > > > Got NAK'ed from Rob on some ealier round due missing "device mode" on this > > IP. I've blatantly overrided this to a host only driver. > > > > These

Re: [PATCH v2] usb: misc: legousbtower: Fix buffers on stack

2017-04-25 Thread Maksim Salau
On Tue, 25 Apr 2017 20:04:24 +0200 Greg Kroah-Hartman wrote: > On Sat, Apr 22, 2017 at 07:24:37PM +0300, Maksim Salau wrote: > > Allocate buffers on HEAP instead of STACK for local structures > > that are to be received using usb_control_msg(). > > > > Signed-off-by:

Re: next build: 1 warnings 1 failures (next/next-20170424)

2017-04-25 Thread Arnd Bergmann
On Mon, Apr 24, 2017 at 11:58 AM, Olof's autobuilder wrote: > --- > > Errors: > > arm.allmodconfig: > ERROR: "__aeabi_uldivmod" [drivers/gpu/drm/arm/mali-dp.ko] undefined! patch sent. > >

[PATCH v3] usb: misc: legousbtower: Fix buffers on stack

2017-04-25 Thread Maksim Salau
Allocate buffers on HEAP instead of STACK for local structures that are to be received using usb_control_msg(). Signed-off-by: Maksim Salau --- Changes in v3: * rebased against usb-next; * removed Tested-by: Alfredo Rafael Vicente Boix ; *

[PATCH] usb: musb: don't mark of_dev_auxdata as initdata

2017-04-25 Thread Arnd Bergmann
The probe function is not __init since it can be called for deferred probing or when unbinding/rebinding the device, and therefore it must not reference objects in __initdata, as pointed out by this link time warning: WARNING: drivers/usb/musb/da8xx.o(.text+0x9d4): Section mismatch in reference

[PATCH v4] usb: typec: Don't prevent using constant typec_mode_desc initializers

2017-04-25 Thread Mats Karrman
In some situations, e.g. when registering alternate modes for local typec ports, it may be handy to use constant mode descriptors. Allow this by changing the mode descriptor arguments of typec_port_register_altmode() et.al. to using const pointers. Signed-off-by: Mats Karrman

Re: issues with commit c1da59dad0eb ("cdc-wdm: Clear read pipeline in case of error")

2017-04-25 Thread Bjørn Mork
Robert Foss writes: > On 2017-04-24 08:02 AM, Bjørn Mork wrote: >> Aleksander Morgado writes: >>> On Thu, Apr 20, 2017 at 10:32 AM, Bjørn Mork wrote: Sorry for being much too late here, but during recent attemts to debug

Re: [PATCH 1/5 v3] usb: host: add DT bindings for faraday fotg2

2017-04-25 Thread Linus Walleij
On Mon, Apr 24, 2017 at 6:53 PM, Hans Ulli Kroll wrote: > Got NAK'ed from Rob on some ealier round due missing "device mode" on this > IP. I've blatantly overrided this to a host only driver. > > These are the needed changes in DT to support both modes > Note the -dr

Re: [PATCH] usb: chipidea: Fix missing resume call after suspend

2017-04-25 Thread Peter Chen
On Mon, Apr 24, 2017 at 01:25:21PM +, Bernhard Walle wrote: > Hi, > > > Peter Chen hat am 24. April 2017 um 05:51 geschrieben: > > > > > The current code logic is: > > - When the resume is received from host, the ci->dirver->resume is > > called, and suspended is

Re: [PATCH 4/5 v3] usb: host: fotg2: add Gemini-specific handling

2017-04-25 Thread Linus Walleij
On Mon, Apr 24, 2017 at 7:06 PM, Hans Ulli Kroll wrote: > please wait for a while, I'm working on some glue code to support both > host and device mode on FOTG. Sure no problem, sorry for being so impatient, it's a character trait. I sent out bindings and drivers for

Re: [PATCH] usb: typec: Don't prevent using constant typec_mode_desc initializers

2017-04-25 Thread Felipe Balbi
Hi, Mats Karrman writes: > From 98ff2be4de83f4d4b5293bfa424c274b25400e1e Mon Sep 17 00:00:00 2001 > From: Mats Karrman > Date: Mon, 24 Apr 2017 15:21:39 +0200 > Subject: [PATCH] usb: typec: Don't prevent using constant > typec_mode_desc

Re: [PATCH] USB: Revert "cdc-wdm: fix "out-of-sync" due to missing notifications"

2017-04-25 Thread Oliver Neukum
Am Freitag, den 21.04.2017, 10:01 +0200 schrieb Bjørn Mork: > This reverts commit 833415a3e781 ("cdc-wdm: fix "out-of-sync" due to > missing notifications") > > There have been several reports of wdm_read returning unexpected EIO > errors with QMI devices using the qmi_wwan driver. The reporters

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-25 Thread Rajaram R
On Mon, Apr 24, 2017 at 11:20 PM, Badhri Jagan Sridharan wrote: > On Sat, Apr 22, 2017 at 2:23 AM, Rajaram R > wrote: >> On Fri, Apr 21, 2017 at 10:13 PM, Guenter Roeck wrote: >>> On Fri, Apr 21, 2017 at 07:57:52PM +0530,

Re: [PATCH] USB: Revert "cdc-wdm: fix "out-of-sync" due to missing notifications"

2017-04-25 Thread Oliver Neukum
Am Freitag, den 21.04.2017, 10:01 +0200 schrieb Bjørn Mork: > There have been several reports of wdm_read returning unexpected EIO > errors with QMI devices using the qmi_wwan driver. The reporters > confirm that reverting prevents these errors. I have been unable to > reproduce the bug myself,

Re: [PATCH] usb: chipidea: udc: fix NULL pointer dereference if udc_start failed

2017-04-25 Thread Peter Chen
On Mon, Apr 24, 2017 at 12:35:51PM +, Jisheng Zhang wrote: > Fix below NULL pointer dereference. we set ci->roles[CI_ROLE_GADGET] > too early in ci_hdrc_gadget_init(), if udc_start() fails due to some > reason, the ci->roles[CI_ROLE_GADGET] check in ci_hdrc_gadget_destroy > can't protect us.

Re: [PATCH] USB: Revert "cdc-wdm: fix "out-of-sync" due to missing notifications"

2017-04-25 Thread Bjørn Mork
Oliver Neukum writes: > Am Freitag, den 21.04.2017, 10:01 +0200 schrieb Bjørn Mork: >> There have been several reports of wdm_read returning unexpected EIO >> errors with QMI devices using the qmi_wwan driver. The reporters >> confirm that reverting prevents these errors. I have

Re: [PATCH] usb: chipidea: udc: fix NULL pointer dereference if udc_start failed

2017-04-25 Thread Jisheng Zhang
Hi Peter, On Tue, 25 Apr 2017 16:29:48 +0800 Peter Chen wrote: > On Mon, Apr 24, 2017 at 12:35:51PM +, Jisheng Zhang wrote: > > Fix below NULL pointer dereference. we set ci->roles[CI_ROLE_GADGET] > > too early in ci_hdrc_gadget_init(), if udc_start() fails due to some > > reason, the

RE: [PATCH] usb: chipidea: udc: fix NULL pointer dereference if udc_start failed

2017-04-25 Thread Peter Chen
>> > diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c >> > index f88e9157fad0..60a786c87c06 100644 >> > --- a/drivers/usb/chipidea/udc.c >> > +++ b/drivers/usb/chipidea/udc.c >> > @@ -1984,6 +1984,7 @@ static void udc_id_switch_for_host(struct >> > ci_hdrc *ci) int

[PATCH] usb: gadget: f_fs: avoid out of bounds access on comp_desc

2017-04-25 Thread William Wu
Companion descriptor is only used for SuperSpeed endpoints, if the endpoints are HighSpeed or FullSpeed, the Companion descriptor will not allocated, so we can only access it if gadget is SuperSpeed. I can reproduce this issue on Rockchip platform rk3368 SoC which supports USB 2.0, and use

[PATCH] usb: chipidea: properly handle host or gadget initialization failure

2017-04-25 Thread Jisheng Zhang
If ci_hdrc_host_init() or ci_hdrc_gadget_init() returns error and the error != -ENXIO, as Peter pointed out, "it stands for initialization for host or gadget has failed", so we'd better return failure rather continue. Signed-off-by: Jisheng Zhang ---

Re: [PATCH] net: hso: fix module unloading

2017-04-25 Thread Johan Hovold
On Mon, Apr 24, 2017 at 09:18:39PM +0200, Andreas Kemnade wrote: > keep tty driver until usb driver is unregistered > rmmod hso > produces traces like this without that: Yeah, a blatant use-after-free. > Signed-off-by: Andreas Kemnade Reviewed-by: Johan Hovold

Re: [PATCH V3 4/4] soc/tegra: pmc: Use the new reset APIs to manage reset controllers

2017-04-25 Thread Jon Hunter
On 25/04/17 05:15, Vivek Gautam wrote: > On 04/24/2017 06:15 PM, Jon Hunter wrote: >> On 18/04/17 12:21, Vivek Gautam wrote: >>> Make use of reset_control_array_*() set of APIs to manage >>> an array of reset controllers available with the device. >> Before we apply this patch, I need to check to

[RFC] usb: chipidea: set dma_ops for the created ci_hdrc platform_device

2017-04-25 Thread Jisheng Zhang
Hi all, After commit 1dccb598df549 ("arm64: simplify dma_get_ops"), the chipidea driver can't work any more on Marvell Berlin arm64 platforms, the reason is the created ci_hdrc platform_device's dma_ops is dummy_dma_ops, so all dma related operations will fail. The fix I can think of would be

Re: [RFC PATCH v5 1/2] usb: typec: USB Type-C Port Manager (tcpm)

2017-04-25 Thread Heikki Krogerus
Hi Guenter, On Fri, Apr 21, 2017 at 03:15:52PM -0700, Guenter Roeck wrote: > +/* > + * Logging > + */ > + > +#ifdef CONFIG_DEBUG_FS > + > +static bool tcpm_log_full(struct tcpm_port *port) > +{ > + return port->logbuffer_tail == > + (port->logbuffer_head + 1) % LOG_BUFFER_ENTRIES;

Re: [PATCH V3 4/4] soc/tegra: pmc: Use the new reset APIs to manage reset controllers

2017-04-25 Thread Philipp Zabel
On Tue, 2017-04-25 at 11:05 +0100, Jon Hunter wrote: > On 25/04/17 05:15, Vivek Gautam wrote: > > On 04/24/2017 06:15 PM, Jon Hunter wrote: > >> On 18/04/17 12:21, Vivek Gautam wrote: > >>> Make use of reset_control_array_*() set of APIs to manage > >>> an array of reset controllers available with

Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack

2017-04-25 Thread Maksim Salau
> + } else if (object_is_on_stack(urb->transfer_buffer)) { > + WARN_ONCE(1, "transfer buffer is on stack\n"); > + ret = -EAGAIN; > } else { Hi, Has anyone considered a fail-safe mode? I.e.: if a

Re: issues with commit c1da59dad0eb ("cdc-wdm: Clear read pipeline in case of error")

2017-04-25 Thread Oliver Neukum
Am Donnerstag, den 20.04.2017, 10:32 +0200 schrieb Bjørn Mork: > > @@ -189,7 +192,13 @@ static void wdm_in_callback(struct urb *urb) > >   } > >   } > >  > > - desc->rerr = status; > > + /* > > +  * only set a new error if there is no previous error. > > +  *

Re: [PATCH V3 4/4] soc/tegra: pmc: Use the new reset APIs to manage reset controllers

2017-04-25 Thread Jon Hunter
On 25/04/17 11:33, Philipp Zabel wrote: > On Tue, 2017-04-25 at 11:05 +0100, Jon Hunter wrote: >> On 25/04/17 05:15, Vivek Gautam wrote: >>> On 04/24/2017 06:15 PM, Jon Hunter wrote: On 18/04/17 12:21, Vivek Gautam wrote: > Make use of reset_control_array_*() set of APIs to manage >

Re: [PATCH V3 4/4] soc/tegra: pmc: Use the new reset APIs to manage reset controllers

2017-04-25 Thread Vivek Gautam
On 04/25/2017 04:24 PM, Jon Hunter wrote: On 25/04/17 11:33, Philipp Zabel wrote: On Tue, 2017-04-25 at 11:05 +0100, Jon Hunter wrote: On 25/04/17 05:15, Vivek Gautam wrote: On 04/24/2017 06:15 PM, Jon Hunter wrote: On 18/04/17 12:21, Vivek Gautam wrote: Make use of

Re: issues with commit c1da59dad0eb ("cdc-wdm: Clear read pipeline in case of error")

2017-04-25 Thread Bjørn Mork
Oliver Neukum writes: > Am Donnerstag, den 20.04.2017, 10:32 +0200 schrieb Bjørn Mork: >> > @@ -189,7 +192,13 @@ static void wdm_in_callback(struct urb *urb) >> >   } >> >   } >> >  >> > - desc->rerr = status; >> > + /* >> > +  * only set a new

Re: [RFC] usb: chipidea: set dma_ops for the created ci_hdrc platform_device

2017-04-25 Thread Arnd Bergmann
On Tue, Apr 25, 2017 at 12:01 PM, Jisheng Zhang wrote: > Hi all, > > After commit 1dccb598df549 ("arm64: simplify dma_get_ops"), the chipidea > driver can't work any more on Marvell Berlin arm64 platforms, the reason > is the created ci_hdrc platform_device's dma_ops is

Re: [PATCH V3 4/4] soc/tegra: pmc: Use the new reset APIs to manage reset controllers

2017-04-25 Thread Jon Hunter
On 25/04/17 12:06, Vivek Gautam wrote: > On 04/25/2017 04:24 PM, Jon Hunter wrote: >> On 25/04/17 11:33, Philipp Zabel wrote: >>> On Tue, 2017-04-25 at 11:05 +0100, Jon Hunter wrote: On 25/04/17 05:15, Vivek Gautam wrote: > On 04/24/2017 06:15 PM, Jon Hunter wrote: >> On 18/04/17

[PATCH] tools: usb: testusb: update default vary for superspeed

2017-04-25 Thread Felipe Balbi
Currently, default vary will not accomodate superspeed endpoints causing unexpected babble errors in the IN direction. Let's update default 'vary' parameter so that we can maintain a "short-less" transfer as hinted at the comment. Reported-by: Ammy Yi Signed-off-by: Felipe

[PATCH] usb: dwc3: pci: add Intel Cannonlake PCI IDs

2017-04-25 Thread Felipe Balbi
From: Heikki Krogerus Intel Cannonlake PCH has the same DWC3 than Intel Sunrisepoint. Add the new IDs to the supported devices. Signed-off-by: Heikki Krogerus Signed-off-by: Felipe Balbi ---

Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack

2017-04-25 Thread Greg Kroah-Hartman
On Tue, Apr 25, 2017 at 01:35:33PM +0300, Maksim Salau wrote: > > + } else if (object_is_on_stack(urb->transfer_buffer)) { > > + WARN_ONCE(1, "transfer buffer is on stack\n"); > > + ret = -EAGAIN; > > } else

Re: [PATCH] usb: chipidea: Fix missing resume call after suspend

2017-04-25 Thread Bernhard Walle
Hi Peter, > Peter Chen hat am 25. April 2017 um 10:14 geschrieben: > > Since you unplug the cable first, and plug in again. The driver will > treat it as connection but not resume event. You may use > /sys/class/udc/ci_hdrc.0/state to get udc's connection, eg "not attached"

Re: [PATCH v2] usb: core: Warn if an URB's transfer_buffer is on stack

2017-04-25 Thread Felipe Balbi
Hi, Greg Kroah-Hartman writes: > On Tue, Apr 25, 2017 at 01:35:33PM +0300, Maksim Salau wrote: >> > + } else if (object_is_on_stack(urb->transfer_buffer)) { >> > + WARN_ONCE(1, "transfer buffer is on stack\n"); >> > +

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-25 Thread Guenter Roeck
On 04/25/2017 01:26 AM, Rajaram R wrote: On Mon, Apr 24, 2017 at 11:20 PM, Badhri Jagan Sridharan wrote: On Sat, Apr 22, 2017 at 2:23 AM, Rajaram R wrote: On Fri, Apr 21, 2017 at 10:13 PM, Guenter Roeck wrote: On Fri, Apr

Re: [PATCH] usb: plusb: Add support for PL-27A1

2017-04-25 Thread David Miller
From: Roman Spychała Date: Thu, 20 Apr 2017 12:04:10 +0200 > From: Roman Spychała > > This patch adds support for the PL-27A1 by adding the appropriate > USB ID's. This chip is used in the goobay Active USB 3.0 Data Link > and Unitek Y-3501 cables. > >

Re: [PATCH] tools: usb: testusb: update default vary for superspeed

2017-04-25 Thread Alan Stern
On Tue, 25 Apr 2017, Felipe Balbi wrote: > Currently, default vary will not accomodate superspeed endpoints > causing unexpected babble errors in the IN direction. Let's update > default 'vary' parameter so that we can maintain a "short-less" > transfer as hinted at the comment. > > Reported-by:

Re: [PATCH] usb: chipidea: udc: fix NULL pointer dereference if udc_start failed

2017-04-25 Thread Stefan Wahren
Am 25.04.2017 um 11:20 schrieb Peter Chen: > diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index f88e9157fad0..60a786c87c06 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -1984,6 +1984,7 @@ static void

Re: [PATCH] net: hso: fix module unloading

2017-04-25 Thread David Miller
From: Andreas Kemnade Date: Mon, 24 Apr 2017 21:18:39 +0200 > keep tty driver until usb driver is unregistered > rmmod hso > produces traces like this without that: ... > Signed-off-by: Andreas Kemnade Applied, thank you. -- To unsubscribe from this