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

2017-04-26 Thread Felipe Balbi
Hi, Alan Stern writes: > 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 a

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

2017-04-26 Thread Jisheng Zhang
On Tue, 25 Apr 2017 17:21:59 +0200 Stefan Wahren wrote: > 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/

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

2017-04-26 Thread Peter Chen
On Tue, Apr 25, 2017 at 05:43:11PM +0800, Jisheng Zhang wrote: > 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. > > Signe

Re: [PATCH] HID: usbhid: Add HID_QUIRK_NOGET for Aten CS-1758 KVM switch

2017-04-26 Thread Jiri Kosina
On Tue, 25 Apr 2017, Vasilis Liaskovitis wrote: > Like other switches, the Aten CS-1758 KVM switch needs a quirk to avoid > spewing errors: > > [12599018.071059] usb 5-2: input irq status -75 received > [12599018.079053] usb 5-2: input irq status -75 received Applied, thanks. -- Jiri Kosina SU

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

2017-04-26 Thread Jisheng Zhang
On Tue, 25 Apr 2017 13:09:27 +0200 Arnd Bergmann wrote: > 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 cr

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

2017-04-26 Thread Peter Chen
On Wed, Apr 26, 2017 at 04:25:26PM +0800, Jisheng Zhang wrote: > On Tue, 25 Apr 2017 17:21:59 +0200 > Stefan Wahren wrote: > > > 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..60a786c8

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

2017-04-26 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. And before destroying the otg, i.e ci_hdrc_otg_destroy(ci), we should also check

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

2017-04-26 Thread Greg Kroah-Hartman
On Tue, Apr 25, 2017 at 10:28:42PM +0300, Maksim Salau wrote: > 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 usi

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

2017-04-26 Thread Greg Kroah-Hartman
On Tue, Apr 25, 2017 at 10:49:21PM +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 ; > Cc: stable > > --- > Changes in v3: >

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

2017-04-26 Thread Greg Kroah-Hartman
On Tue, Apr 25, 2017 at 10:04:53PM +0200, Arnd Bergmann wrote: > 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: > > WARNI

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

2017-04-26 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 Balbi --- Changes sin

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

2017-04-26 Thread Heikki Krogerus
Hi Mats, On Tue, Apr 25, 2017 at 11:49:47PM +0200, Mats Karrman wrote: > 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

[PATCH] staging: gdm724x: gdm_mux: fix use-after-free on module unload

2017-04-26 Thread Johan Hovold
Make sure to deregister the USB driver before releasing the tty driver to avoid use-after-free in the USB disconnect callback where the tty devices are deregistered. Fixes: 61e121047645 ("staging: gdm7240: adding LTE USB driver") Cc: stable # 3.12 Cc: Won Kang Signed-off-by: Johan Hovold --

[PATCH 4/5] usb: gadget: udc: renesas_usb3: Fix PN_INT_ENA disabling timing

2017-04-26 Thread Yoshihiro Shimoda
The PN_INT_ENA register should be used after usb3_pn_change() is called. So, this patch moves the access from renesas_usb3_stop_controller() to usb3_disable_pipe_n(). Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller") Signed-off-by: Yoshihiro S

[PATCH 2/5] usb: gadget: udc: renesas_usb3: fix deadlock by spinlock

2017-04-26 Thread Yoshihiro Shimoda
This patch fixes an issue that this driver is possible to cause deadlock by double-spinclocked in renesas_usb3_stop_controller(). So, this patch removes spinlock API calling in renesas_usb3_stop(). (In other words, the previous code had a redundant lock.) Fixes: 746bfe63bba3 ("usb: gadget: renesas

[PATCH 5/5] usb: gadget: udc: renesas_usb3: add support for dedicated DMAC

2017-04-26 Thread Yoshihiro Shimoda
The USB3.0 peripheral controller on R-Car SoCs has a dedicated DMAC. The DMAC needs a "PRD table" in system memory and the DMAC can have four PRD tables. This patch adds support for the DMAC. Signed-off-by: Yoshihiro Shimoda --- drivers/usb/gadget/udc/renesas_usb3.c | 393 +++

[PATCH 1/5] usb: gadget: udc: renesas_usb3: fix pm_runtime functions calling

2017-04-26 Thread Yoshihiro Shimoda
This patch fixes an issue that this driver is possible to access the registers before pm_runtime_get_sync() if a gadget driver is installed first. After that, oops happens on R-Car Gen3 environment. To avoid it, this patch changes the pm_runtime call timing from probe/remove to udc_start/udc_stop.

[PATCH 0/5] usb: gadget: udc: renesas_usb3: add DMAC support

2017-04-26 Thread Yoshihiro Shimoda
This patch set is based on the latest Feribe's usb.git / testing/next branch (the commit id = 28ea6be01e2cf244c461a40c8e9593816f894412.) This patch set has 2 things: - Fixes some minor issues. - Add support for dedicated DMAC. If possible, I want the patches [1/5] to [4/5] to be applied to v4.1

[PATCH 3/5] usb: gadget: udc: renesas_usb3: lock for PN_ registers access

2017-04-26 Thread Yoshihiro Shimoda
This controller disallows to change the PIPE until reading/writing a packet finishes. However. the previous code is not enough to hold the lock in some functions. So, this patch fixes it. Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller") Signe

[PATCH] net: hso: register netdev later to avoid a race condition

2017-04-26 Thread Andreas Kemnade
If the netdev is accessed before the urbs are initialized, there will be NULL pointer dereferences. That is avoided by registering it when it is fully initialized. This case occurs e.g. if dhcpcd is running in the background and the device is probed, either after insmod hso or when the device appe

[PATCH 1/4] usb: dwc2: gadget: Fix in TX FIFO initialization flow.

2017-04-26 Thread Sevak Arakelyan
We need to update DPTXFSIZN even if the depth of current TX FIFO is set to 0. Loop only for needed TX FIFO count times. This will fix the issue with wrong insufficient fifo memory WARN_ON. Signed-off-by: Sevak Arakelyan --- drivers/usb/dwc2/gadget.c | 10 +++--- 1 file changed, 7 insertions(

[PATCH 3/4] usb: dwc2: gadget: Replace code with function calls.

2017-04-26 Thread Sevak Arakelyan
Replace TX and RX FIFO's flushing and waiting code in dwc2_hsotg_init_fifo with dwc2_flush_tx_fifo and dwc2_flush_rx_fifo function calls accordingly. Signed-off-by: Sevak Arakelyan --- drivers/usb/dwc2/gadget.c | 34 -- 1 file changed, 8 insertions(+), 26 deletion

[PATCH 2/4] usb: dwc2: gadget: Remove duplicated FIFO initialization.

2017-04-26 Thread Sevak Arakelyan
dwc2_hsotg_init is called in dwc2_hsotg_core_init_disconnected and dwc2_hsotg_init functions. It should be in dwc2_hsotg_core_init_disconnected and don't need to be called for the second time, so remove the duplicated one from dwc2_hsotg_init. Also, remove useless debug prints. Signed-off-by: Seva

[PATCH 4/4] usb: dwc2: gadget: Separate non-periodic and periodic FIFO inits

2017-04-26 Thread Sevak Arakelyan
Separate dwc2_hsotg_init_fifo function into 2 different functions, for periodic and non-periodic FIFOs. Initialization of non-periodic FIFOs must be done after soft or USB resets, while initialization of periodic FIFOs must be done only after soft reset. Signed-off-by: Sevak Arakelyan --- driver

[PATCH 0/4] usb: dwc2: gadget: Fix dynamic FIFO initialization flow

2017-04-26 Thread Sevak Arakelyan
This series fixes FIFO initialization issue of getting wrong insufficent FIFO memory warning. Fixes duplicate FIFO initialization issue, replaces FIFO flushing code with function calls. Separates initialization of periodic and non-periodic FIFOs. Tested on HAPS platform with DWC_hsotg IP version

Re: [PATCH] usb: host: xhci: remove #ifdef around PM functions

2017-04-26 Thread Greg Kroah-Hartman
On Fri, Apr 21, 2017 at 11:42:54PM +0200, Arnd Bergmann wrote: > The #ifdef is slightly wrong as it doesn't cover the xhci_priv_resume_quirk() > function, causing a harmless warning: > > drivers/usb/host/xhci-plat.c:58:12: error: 'xhci_priv_resume_quirk' defined > but not used [-Werror=unused-fun

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

2017-04-26 Thread Guenter Roeck
From: Guenter Roeck This driver implements the USB Type-C Power Delivery state machine for both source and sink ports. Alternate mode support is not fully implemented. The driver attaches to the USB Type-C class code implemented in the following patches. usb: typec: add driver for Intel

[PATCH v6 2/2] usb: typec: Type-C Port Controller Interface driver (tcpci)

2017-04-26 Thread Guenter Roeck
From: Guenter Roeck The port controller interface driver interconnects the Type-C Port Manager with a Type-C Port Controller Interface (TCPCI) compliant port controller. Signed-off-by: Guenter Roeck Signed-off-by: Guenter Roeck --- v6: - Move to drivers/staging - Use PTR_ERR_OR_ZERO() v5: - AP

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

2017-04-26 Thread Guenter Roeck
On Wed, Apr 26, 2017 at 03:26:11PM -0700, Guenter Roeck wrote: > From: Guenter Roeck > > This driver implements the USB Type-C Power Delivery state machine > for both source and sink ports. Alternate mode support is not > fully implemented. > > The driver attaches to the USB Type-C class code im

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

2017-04-26 Thread Rajaram R
On Tue, Apr 25, 2017 at 7:40 PM, Guenter Roeck wrote: > 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

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

2017-04-26 Thread Greg Kroah-Hartman
On Wed, Apr 26, 2017 at 06:15:08PM -0700, Guenter Roeck wrote: > On Wed, Apr 26, 2017 at 03:26:11PM -0700, Guenter Roeck wrote: > > From: Guenter Roeck > > > > This driver implements the USB Type-C Power Delivery state machine > > for both source and sink ports. Alternate mode support is not > >

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

2017-04-26 Thread Maksim Salau
> >* removed Tested-by: Alfredo Rafael Vicente Boix ; > > I added this back, as it matters, and your change from the previous > version was trivial. > > >* removed Cc: sta...@vger.kernel.org > > since this patch doesn't apply against v4.10.12 > > I added this back as well