Re: [PATCH 1/2] dt-bindings: leds: document new usb-ports property

2017-01-03 Thread Rafał Miłecki
On 01/03/2017 09:52 PM, Rob Herring wrote: On Thu, Dec 29, 2016 at 02:03:04PM +0100, Rafał Miłecki wrote: From: Rafał Miłecki Some LEDs can be related to particular USB ports (common case for home routers). This property allows describing such a relation. Signed-off-by:

[PATCH] usb: gadget: composite: Fix function used to free memory

2017-01-03 Thread Christophe JAILLET
'cdev->os_desc_req' has been allocated with 'usb_ep_alloc_request()' so 'usb_ep_free_request()' should be used to free it. Signed-off-by: Christophe JAILLET --- drivers/usb/gadget/composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

RE: [PATCH v3 2/3] USB3/DWC3: Add property "snps, incr-burst-type-adjustment" for INCR burst type

2017-01-03 Thread Jerry Huang
Hi, Rob, > -Original Message- > From: Rob Herring [mailto:r...@kernel.org] > Sent: Wednesday, January 04, 2017 5:24 AM > To: Jerry Huang > Cc: ba...@kernel.org; mark.rutl...@arm.com; catalin.mari...@arm.com; > will.dea...@arm.com; li...@armlinux.org.uk;

[PATCH 2/2] usb: gadget: uac2: add req_number as parameter

2017-01-03 Thread Peter Chen
There are only two requests for uac2, it may not be enough at high loading system which usb interrupt handler can't be serviced on time, then the data will be lost since it is isoc transfer for audio. In this patch, we introduce a parameter for the number for usb request, and the user can

[PATCH 1/2] usb: gadget: f_uac2: improve error handling

2017-01-03 Thread Peter Chen
If it is out of memory, we should return -ENOMEM; Signed-off-by: Peter Chen --- drivers/usb/gadget/function/f_uac2.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c

[PATCH 2/4] usb: xhci: avoid unnecessary calculation

2017-01-03 Thread Lu Baolu
No need to calculate remainder and length_field, if there is no data phase of a control transfer. Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git

[PATCH 1/4] usb: xhci: remove unnecessary assignment

2017-01-03 Thread Lu Baolu
Drop an unnecessary assignment in prepare_transfer(). Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index bdf6b13..3cc303f 100644 ---

[PATCH 0/4] several cleanup patches

2017-01-03 Thread Lu Baolu
Hi Mathias, This series includes several tiny cleanup patches for xhci host controller driver. These make the code slightly more readable. There's no functional change. Please consider it for your for-usb-next branch. Best regards, Lu Baolu Lu Baolu (4): usb: xhci: remove unnecessary

[PATCH 3/4] usb: xhci: use list_is_singular for cmd_list

2017-01-03 Thread Lu Baolu
Use list_is_singular() to check if cmd_list has only one entry. Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-ring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index

[PATCH 4/4] usb: xhci: remove unnecessary return in xhci_pci_setup()

2017-01-03 Thread Lu Baolu
Remove the unnecessary return line in xhci_pci_setup(). Signed-off-by: Lu Baolu --- drivers/usb/host/xhci-pci.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index e96ae80..ace3f57 100644 ---

Re: [PATCH 0/5 v2] Fixes and workarounds for dwc2 on HiKey board

2017-01-03 Thread John Youn
On 1/3/2017 12:05 PM, John Stultz wrote: > On Tue, Jan 3, 2017 at 11:52 AM, John Stultz wrote: >> Hope everyone had a happy new years! >> >> I just wanted to send out my current queue of patches for dwc2 >> controller on the HiKey board for consideration for the 4.11 >>

Re: [PATCH 0/5 v2] Fixes and workarounds for dwc2 on HiKey board

2017-01-03 Thread John Stultz
On Tue, Jan 3, 2017 at 4:31 PM, John Youn wrote: > On 1/3/2017 12:05 PM, John Stultz wrote: >> On Tue, Jan 3, 2017 at 11:52 AM, John Stultz wrote: >>> Hope everyone had a happy new years! >>> >>> I just wanted to send out my current queue of

Re: [PATCH v2 0/7] musb fixes for v4.10-rc3

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 06:13:45PM -0600, Bin Liu wrote: > Hi Greg, > > This is the v2 of musb fixes for v4.10-rc3. The regressions being fixed are > not > in v4.10-rc1, but introduced in earlier v4.9, v3.x, and some of them even in Ahh, I meant they are not _new_ in v4.10-rc1. Regards, -Bin.

[PATCH v2 2/7] usb: musb: dsps: implement clear_ep_rxintr() callback

2017-01-03 Thread Bin Liu
During dma teardown for dequque urb, if musb load is high, musb might generate bogus rx ep interrupt even when the rx fifo is flushed. In such case any of the follow log messages could happen. musb_host_rx 1853: BOGUS RX2 ready, csr , count 0 musb_host_rx 1936: RX3 dma busy, csr 2020

[PATCH v2 4/7] usb: musb: fix compilation warning on unused function

2017-01-03 Thread Bin Liu
From: Jérémy Lefaure The function musb_run_resume_work is called only when CONFIG_PM is enabled. So this function should not be defined when CONFIG_PM is disabled. Otherwise the compiler issues a warning: drivers/usb/musb/musb_core.c:2057:12: error:

[PATCH v2 5/7] usb: musb: debugfs: allow forcing host mode together with speed in testmode

2017-01-03 Thread Bin Liu
From: Pali Rohár Based on the musb ug, force_host bit is allowed to be set along with force_hs or force_fs bit. It could help to implement forced host mode via testmode on Nokia N900. Signed-off-by: Pali Rohár Signed-off-by: Bin Liu

[PATCH v2 6/7] usb: musb: fix runtime PM in debugfs

2017-01-03 Thread Bin Liu
MUSB driver now has runtime PM support, but the debugfs driver misses the PM _get/_put() calls, which could cause MUSB register access failure. Cc: sta...@vger.kernel.org # 4.9+ Signed-off-by: Bin Liu Acked-by: Tony Lindgren --- v2: no change.

[PATCH v2 7/7] usb: musb: blackfin: add bfin_fifo_offset in bfin_ops

2017-01-03 Thread Bin Liu
From: Jérémy Lefaure The function bfin_fifo_offset is defined but not used: drivers/usb/musb/blackfin.c:36:12: warning: ‘bfin_fifo_offset’ defined but not used [-Wunused-function] static u32 bfin_fifo_offset(u8 epnum) ^~~~ Adding

[PATCH v2 0/7] musb fixes for v4.10-rc3

2017-01-03 Thread Bin Liu
Hi Greg, This is the v2 of musb fixes for v4.10-rc3. The regressions being fixed are not in v4.10-rc1, but introduced in earlier v4.9, v3.x, and some of them even in the initial musb drivers back in 2008. This v2 dropped some patches in v1, and revised the commit message in some of the patches.

[PATCH v2 1/7] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Bin Liu
During dma teardown for dequque urb, if musb load is high, musb might generate bogus rx ep interrupt even when the rx fifo is flushed. In such case any of the follow log messages could happen. musb_host_rx 1853: BOGUS RX2 ready, csr , count 0 musb_host_rx 1936: RX3 dma busy,

[PATCH v2 3/7] usb: musb: Fix trying to free already-free IRQ 4

2017-01-03 Thread Bin Liu
From: Tony Lindgren When unloading omap2430, we can get the following splat: WARNING: CPU: 1 PID: 295 at kernel/irq/manage.c:1478 __free_irq+0xa8/0x2c8 Trying to free already-free IRQ 4 ... [] (free_irq) from [] (musbhs_dma_controller_destroy+0x28/0xb0 [musb_hdrc]) []

RE: [PATCH v13 05/10] usbip: exporting devices: modifications to daemon

2017-01-03 Thread fx IWATA NOBUO
Dear Krzysztof, I posted new version and it's improved thanks to your review. About introducing usbip_meta_driver_.*(), I decided not to use _meta_. In this series, it becomes an abstraction among daemons so _meta_ is too much for it. usbipd_ prefix has been used so I thought

Re: [PATCH v3 2/3] USB3/DWC3: Add property "snps, incr-burst-type-adjustment" for INCR burst type

2017-01-03 Thread Rob Herring
On Thu, Dec 22, 2016 at 8:52 PM, Jerry Huang wrote: > Hi, Rob, >> -Original Message- >> From: Rob Herring [mailto:r...@kernel.org] >> Sent: Friday, December 23, 2016 2:45 AM >> To: Jerry Huang >> Cc: ba...@kernel.org; mark.rutl...@arm.com;

Re: xHCI issues Reset Device Command at invalid states

2017-01-03 Thread Alan Stern
On Mon, 2 Jan 2017, Felipe Balbi wrote: > Hi, > > Alan Stern writes: > > On Mon, 2 Jan 2017, Mathias Nyman wrote: > > > >> On 30.12.2016 14:01, Felipe Balbi wrote: > >> > > >> > Hi Mathias, > >> > > >> > So the problem I found with v4.10-rc1 doesn't appear to be a >

[PATCH v2] USB: cypress_m8: remove unused variable

2017-01-03 Thread Sudip Mukherjee
From: Sudip Mukherjee The variable havedata was only being set but never used afterwards. Signed-off-by: Sudip Mukherjee --- v2: changed the from line drivers/usb/serial/cypress_m8.c | 5 - 1 file changed, 5 deletions(-)

Re: [PATCH 1/2] dt-bindings: leds: document new usb-ports property

2017-01-03 Thread Rob Herring
On Thu, Dec 29, 2016 at 02:03:04PM +0100, Rafał Miłecki wrote: > From: Rafał Miłecki > > Some LEDs can be related to particular USB ports (common case for home > routers). This property allows describing such a relation. > > Signed-off-by: Rafał Miłecki >

Re: [PATCH] USB: ohci-omap: defer probe if PHY is missing

2017-01-03 Thread Aaro Koskinen
Hi, On Tue, Jan 03, 2017 at 08:05:04PM +0100, Greg Kroah-Hartman wrote: > On Tue, Jan 03, 2017 at 08:50:31PM +0200, Aaro Koskinen wrote: > > On Tue, Jan 03, 2017 at 05:51:43PM +0100, Greg Kroah-Hartman wrote: > > > On Mon, Jan 02, 2017 at 10:53:55PM +0200, Aaro Koskinen wrote: > > > > Defer probe

Re: [PATCH 0/5 v2] Fixes and workarounds for dwc2 on HiKey board

2017-01-03 Thread John Stultz
On Tue, Jan 3, 2017 at 11:52 AM, John Stultz wrote: > Hope everyone had a happy new years! > > I just wanted to send out my current queue of patches for dwc2 > controller on the HiKey board for consideration for the 4.11 > merge window. > > This does exclude my patchset[1]

Re: [PATCH 00/16] musb fixes for v4.10-rc3

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 05:27:53PM +0100, Greg KH wrote: > On Tue, Jan 03, 2017 at 10:01:43AM -0600, Bin Liu wrote: > > On Tue, Jan 03, 2017 at 04:38:47PM +0100, Greg KH wrote: > > > On Tue, Jan 03, 2017 at 09:15:05AM -0600, Bin Liu wrote: > > > > Hi Greg, > > > > > > > > These are musb fixes for

[PATCH 4/5 v2] usb: dwc2: Avoid suspending if we're in gadget mode

2017-01-03 Thread John Stultz
I've found when booting HiKey with the usb gadget cable attached if I then try to connect via adb, I get an infinite spew of: dwc2 f72c.usb: dwc2_hsotg_ep_sethalt(ep ffc0790ecb18 ep1out, 0) dwc2 f72c.usb: dwc2_hsotg_ep_sethalt(ep ffc0790eca18 ep1in, 0) It seems that the usb

[PATCH 3/5 v2] usb: dwc2: Force port resume on switching to device mode

2017-01-03 Thread John Stultz
From: Chen Yu We've seen failures when switching between host and gadget mode, which was diagnosed as being caused due to the bus being auto-suspended when we switched. So this patch forces a port resume when switching to device mode if the bus is suspended. Cc: Wei Xu

[PATCH 5/5 v2] usb: dwc2: Add a quirk to allow speed negotiation for Hisilicon Hi6220

2017-01-03 Thread John Stultz
From: Chen Yu The Hi6220's usb controller is limited in that it does not support "Split Transactions", so it does not support communicating with low-speed and full-speed devices behind a high-speed hub. Thus it requires a quirk so that we can manually drop the usb speed

[PATCH 1/5 v2] usb: dwc2: Avoid sleeping while holding hsotg->lock

2017-01-03 Thread John Stultz
Basically when plugging in various cables in different orders, I'm occasionally seeing the following BUG splat: [ 86.215403] BUG: scheduling while atomic: kworker/u16:2/53/0x0002 [ 86.219164] usb 1-1: USB disconnect, device number 9 [ 86.226845] Preemption disabled at:[ 86.230218] []

[PATCH 0/5 v2] Fixes and workarounds for dwc2 on HiKey board

2017-01-03 Thread John Stultz
Hope everyone had a happy new years! I just wanted to send out my current queue of patches for dwc2 controller on the HiKey board for consideration for the 4.11 merge window. This does exclude my patchset[1] to add extcon support to dwc2, which John Youn suspects a pending rework of the dwc2

[PATCH 2/5 v2] usb: dwc2: Workaround case where GOTGCTL state is wrong

2017-01-03 Thread John Stultz
When removing a USB-A to USB-otg adapter cable, we get a change status irq, and then in dwc2_conn_id_status_change, we erroniously see the GOTGCTL_CONID_B flag set. This causes us to get stuck in the "while (!dwc2_is_device_mode(hsotg))" loop, spitting out "Waiting for Peripheral Mode, Mode=Host"

Re: [PATCH 04/16] usb: musb: remove musb_generic_disable function

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 04:36:44PM +0100, Greg KH wrote: > On Tue, Jan 03, 2017 at 09:15:09AM -0600, Bin Liu wrote: > > musb_generic_disable() only has two lines of code. So remove it and let > > the callers directly call those two lines. > > > > Signed-off-by: Bin Liu > > --- > >

Re: [PATCH 01/16] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 09:07:05PM +0200, Felipe Balbi wrote: [...] > >> IOW, since you're Ccing stable, you consider this to be a > >> regression. Then the question reads as: "Are you missing a 'Fixes: foo > >> bar baz' in your commit log?" > > > > I think it is difficult to find out the commit

Re: [PATCH] USB: ohci-omap: defer probe if PHY is missing

2017-01-03 Thread Felipe Balbi
Hi, Greg Kroah-Hartman writes: > On Tue, Jan 03, 2017 at 08:50:31PM +0200, Aaro Koskinen wrote: >> Hi, >> >> On Tue, Jan 03, 2017 at 05:51:43PM +0100, Greg Kroah-Hartman wrote: >> > On Mon, Jan 02, 2017 at 10:53:55PM +0200, Aaro Koskinen wrote: >> > > Defer probe if

Re: [PATCH 01/16] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 07:47:07PM +0100, Greg KH wrote: > On Tue, Jan 03, 2017 at 12:43:19PM -0600, Bin Liu wrote: > > On Tue, Jan 03, 2017 at 07:31:58PM +0100, Greg KH wrote: > > > On Tue, Jan 03, 2017 at 11:54:31AM -0600, Bin Liu wrote: > > > > On Tue, Jan 03, 2017 at 07:37:18PM +0200, Felipe

Re: [PATCH 01/16] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Felipe Balbi
Hi, Bin Liu writes: >> Bin Liu writes: >> > On Tue, Jan 03, 2017 at 05:28:22PM +0100, Greg KH wrote: >> >> On Tue, Jan 03, 2017 at 09:47:47AM -0600, Bin Liu wrote: >> >> > On Tue, Jan 03, 2017 at 04:34:48PM +0100, Greg KH wrote: >> >> > > On Tue, Jan 03, 2017 at

Re: [PATCH] USB: ohci-omap: defer probe if PHY is missing

2017-01-03 Thread Greg Kroah-Hartman
On Tue, Jan 03, 2017 at 08:50:31PM +0200, Aaro Koskinen wrote: > Hi, > > On Tue, Jan 03, 2017 at 05:51:43PM +0100, Greg Kroah-Hartman wrote: > > On Mon, Jan 02, 2017 at 10:53:55PM +0200, Aaro Koskinen wrote: > > > Defer probe if PHY is missing. E.g. on Nokia 770 several modules needs > > > to be

Re: [PATCH 04/16] usb: musb: remove musb_generic_disable function

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 05:30:56PM +0100, Greg KH wrote: > On Tue, Jan 03, 2017 at 10:16:53AM -0600, Bin Liu wrote: > > On Tue, Jan 03, 2017 at 04:36:44PM +0100, Greg KH wrote: > > > On Tue, Jan 03, 2017 at 09:15:09AM -0600, Bin Liu wrote: > > > > musb_generic_disable() only has two lines of code.

Re: [PATCH 11/16] usb: musb: da8xx: Add support of suspend / resume

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 04:37:58PM +0100, Greg KH wrote: > On Tue, Jan 03, 2017 at 09:15:16AM -0600, Bin Liu wrote: > > From: Alexandre Bailon > > > > Implement PM methods specifics for da8xx glue. > > The only thing to do is to power off the phy. > > As the registers are

Re: [PATCH 05/16] usb: musb: dsps: remove redundant code

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 04:37:33PM +0100, Greg KH wrote: > On Tue, Jan 03, 2017 at 09:15:10AM -0600, Bin Liu wrote: > > The session is cleared in the core whenever musb_platform_disable() is > > called, so clearing it in the glue driver *_musb_disable() is redundant. > > redundant is not a

Re: [PATCH 03/16] usb: musb: Fix trying to free already-free IRQ 4

2017-01-03 Thread Tony Lindgren
* Bin Liu [170103 10:35]: > Tony, > > On Tue, Jan 03, 2017 at 04:36:14PM +0100, Greg KH wrote: > > On Tue, Jan 03, 2017 at 09:15:08AM -0600, Bin Liu wrote: > > > From: Tony Lindgren > > > > > > When unloading omap2430, we can get the following splat: > > > > >

Re: [PATCH] USB: ohci-omap: defer probe if PHY is missing

2017-01-03 Thread Aaro Koskinen
Hi, On Tue, Jan 03, 2017 at 05:51:43PM +0100, Greg Kroah-Hartman wrote: > On Mon, Jan 02, 2017 at 10:53:55PM +0200, Aaro Koskinen wrote: > > Defer probe if PHY is missing. E.g. on Nokia 770 several modules needs > > to be loaded to get the PHY going and ohci-omap should wait for those. > > > >

Re: [PATCH 01/16] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Greg KH
On Tue, Jan 03, 2017 at 12:43:19PM -0600, Bin Liu wrote: > On Tue, Jan 03, 2017 at 07:31:58PM +0100, Greg KH wrote: > > On Tue, Jan 03, 2017 at 11:54:31AM -0600, Bin Liu wrote: > > > On Tue, Jan 03, 2017 at 07:37:18PM +0200, Felipe Balbi wrote: > > > > IOW, since you're Ccing stable, you consider

Re: [PATCH 01/16] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 07:31:58PM +0100, Greg KH wrote: > On Tue, Jan 03, 2017 at 11:54:31AM -0600, Bin Liu wrote: > > On Tue, Jan 03, 2017 at 07:37:18PM +0200, Felipe Balbi wrote: > > > IOW, since you're Ccing stable, you consider this to be a > > > regression. Then the question reads as: "Are

Re: [PATCH 03/16] usb: musb: Fix trying to free already-free IRQ 4

2017-01-03 Thread Bin Liu
Tony, On Tue, Jan 03, 2017 at 04:36:14PM +0100, Greg KH wrote: > On Tue, Jan 03, 2017 at 09:15:08AM -0600, Bin Liu wrote: > > From: Tony Lindgren > > > > When unloading omap2430, we can get the following splat: > > > > WARNING: CPU: 1 PID: 295 at kernel/irq/manage.c:1478

Re: [PATCH 01/16] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Greg KH
On Tue, Jan 03, 2017 at 11:54:31AM -0600, Bin Liu wrote: > On Tue, Jan 03, 2017 at 07:37:18PM +0200, Felipe Balbi wrote: > > IOW, since you're Ccing stable, you consider this to be a > > regression. Then the question reads as: "Are you missing a 'Fixes: foo > > bar baz' in your commit log?" > > I

[PATCH v2 2/2] usb: musb: dsps: implement clear_ep_rxintr() callback

2017-01-03 Thread Bin Liu
During dma teardown for dequque urb, if musb load is high, musb might generate bogus rx ep interrupt even when the rx fifo is flushed. In such case any of the follow log messages could happen. musb_host_rx 1853: BOGUS RX2 ready, csr , count 0 musb_host_rx 1936: RX3 dma busy, csr 2020

[PATCH v2 1/2] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Bin Liu
During dma teardown for dequque urb, if musb load is high, musb might generate bogus rx ep interrupt even when the rx fifo is flushed. In such case any of the follow log messages could happen. musb_host_rx 1853: BOGUS RX2 ready, csr , count 0 musb_host_rx 1936: RX3 dma busy,

[PATCH v2 0/2] usb: musb: fix bogus rx endpoint interrupt

2017-01-03 Thread Bin Liu
Hi, This fixes a long standing musb bogus rx interrupt problem. I am not sure on other platforms, but on AM335x with CPPI DMA enabled, occasionally any of the following kernel messages shows up from musb driver. (The endpoint number is random, of cause.) musb_host_rx 1853: BOGUS RX2 ready,

Re: [PATCH 01/16] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 07:37:18PM +0200, Felipe Balbi wrote: > > Hi Bin, > > Bin Liu writes: > > On Tue, Jan 03, 2017 at 05:28:22PM +0100, Greg KH wrote: > >> On Tue, Jan 03, 2017 at 09:47:47AM -0600, Bin Liu wrote: > >> > On Tue, Jan 03, 2017 at 04:34:48PM +0100, Greg KH wrote:

Re: [PATCH 02/37] usb: host: xhci: handle COMP_STOP from SETUP phase too

2017-01-03 Thread Felipe Balbi
Hi, Mathias Nyman writes: > On 29.12.2016 13:00, Felipe Balbi wrote: >> Stop Endpoint command can come at any point and we >> have no control of that. We should make sure to >> handle COMP_STOP on SETUP phase as well, otherwise >> urb->actual_lenght might be set

Re: [PATCH 01/16] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Felipe Balbi
Hi Bin, Bin Liu writes: > On Tue, Jan 03, 2017 at 05:28:22PM +0100, Greg KH wrote: >> On Tue, Jan 03, 2017 at 09:47:47AM -0600, Bin Liu wrote: >> > On Tue, Jan 03, 2017 at 04:34:48PM +0100, Greg KH wrote: >> > > On Tue, Jan 03, 2017 at 09:15:06AM -0600, Bin Liu wrote: >> > > >

Re: [PATCH 01/16] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Greg KH
On Tue, Jan 03, 2017 at 11:07:42AM -0600, Bin Liu wrote: > On Tue, Jan 03, 2017 at 05:28:22PM +0100, Greg KH wrote: > > On Tue, Jan 03, 2017 at 09:47:47AM -0600, Bin Liu wrote: > > > On Tue, Jan 03, 2017 at 04:34:48PM +0100, Greg KH wrote: > > > > On Tue, Jan 03, 2017 at 09:15:06AM -0600, Bin Liu

Re: [PATCH 01/16] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 11:07:42AM -0600, Bin Liu wrote: > On Tue, Jan 03, 2017 at 05:28:22PM +0100, Greg KH wrote: > > On Tue, Jan 03, 2017 at 09:47:47AM -0600, Bin Liu wrote: > > > On Tue, Jan 03, 2017 at 04:34:48PM +0100, Greg KH wrote: > > > > On Tue, Jan 03, 2017 at 09:15:06AM -0600, Bin Liu

Re: Oops with dwc3 in device mode and functionfs

2017-01-03 Thread Vincent Pelletier
Checking more, I think the 3 "do {...} while(--count)" loops in f_fs.c are wrong: they should be "while(count--){...}" ("git format-patch" attached, sorry, I'm on a dev-hostile mail client at the moment): - count covers function-specific endpoint, so it is 0 when no endpoint is declared, which

Re: [PATCH 00/16] musb fixes for v4.10-rc3

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 05:57:47PM +0100, Greg KH wrote: > On Tue, Jan 03, 2017 at 10:50:52AM -0600, Bin Liu wrote: > > On Tue, Jan 03, 2017 at 05:27:53PM +0100, Greg KH wrote: > > > On Tue, Jan 03, 2017 at 10:01:43AM -0600, Bin Liu wrote: > > > > On Tue, Jan 03, 2017 at 04:38:47PM +0100, Greg KH

Re: [PATCH 01/16] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 05:28:22PM +0100, Greg KH wrote: > On Tue, Jan 03, 2017 at 09:47:47AM -0600, Bin Liu wrote: > > On Tue, Jan 03, 2017 at 04:34:48PM +0100, Greg KH wrote: > > > On Tue, Jan 03, 2017 at 09:15:06AM -0600, Bin Liu wrote: > > > > During dma teardown for dequque urb, musb might

Re: [PATCH 02/37] usb: host: xhci: handle COMP_STOP from SETUP phase too

2017-01-03 Thread Mathias Nyman
On 29.12.2016 13:00, Felipe Balbi wrote: Stop Endpoint command can come at any point and we have no control of that. We should make sure to handle COMP_STOP on SETUP phase as well, otherwise urb->actual_lenght might be set to negative values in some occasions such as below: urb->length = 4;

Re: [PATCH 01/24] USB: serial: cyberjack: fix NULL-deref at open

2017-01-03 Thread Greg KH
On Tue, Jan 03, 2017 at 05:48:05PM +0100, Johan Hovold wrote: > On Tue, Jan 03, 2017 at 05:27:07PM +0100, Greg Kroah-Hartman wrote: > > On Tue, Jan 03, 2017 at 04:39:40PM +0100, Johan Hovold wrote: > > > Fix NULL-pointer dereference when clearing halt at open should the device > > > lack a

Re: [PATCH 00/16] musb fixes for v4.10-rc3

2017-01-03 Thread Greg KH
On Tue, Jan 03, 2017 at 10:50:52AM -0600, Bin Liu wrote: > On Tue, Jan 03, 2017 at 05:27:53PM +0100, Greg KH wrote: > > On Tue, Jan 03, 2017 at 10:01:43AM -0600, Bin Liu wrote: > > > On Tue, Jan 03, 2017 at 04:38:47PM +0100, Greg KH wrote: > > > > On Tue, Jan 03, 2017 at 09:15:05AM -0600, Bin Liu

Re: [PATCH] USB: ohci-omap: defer probe if PHY is missing

2017-01-03 Thread Greg Kroah-Hartman
On Mon, Jan 02, 2017 at 10:53:55PM +0200, Aaro Koskinen wrote: > Defer probe if PHY is missing. E.g. on Nokia 770 several modules needs > to be loaded to get the PHY going and ohci-omap should wait for those. > > Signed-off-by: Aaro Koskinen Is this a new bug? The 770 has

Re: [PATCH 01/24] USB: serial: cyberjack: fix NULL-deref at open

2017-01-03 Thread Johan Hovold
On Tue, Jan 03, 2017 at 05:27:07PM +0100, Greg Kroah-Hartman wrote: > On Tue, Jan 03, 2017 at 04:39:40PM +0100, Johan Hovold wrote: > > Fix NULL-pointer dereference when clearing halt at open should the device > > lack a bulk-out endpoint. > > > > Unable to handle kernel NULL pointer dereference

Re: [PATCH 04/16] usb: musb: remove musb_generic_disable function

2017-01-03 Thread Greg KH
On Tue, Jan 03, 2017 at 10:16:53AM -0600, Bin Liu wrote: > On Tue, Jan 03, 2017 at 04:36:44PM +0100, Greg KH wrote: > > On Tue, Jan 03, 2017 at 09:15:09AM -0600, Bin Liu wrote: > > > musb_generic_disable() only has two lines of code. So remove it and let > > > the callers directly call those two

Re: [PATCH 0/3] usb: xhci: Add broken port disable quirk

2017-01-03 Thread Mathias Nyman
On 03.01.2017 14:53, Felipe Balbi wrote: Hi, Roger Quadros writes: Mathias & Felipe, On 17/11/16 17:01, Roger Quadros wrote: Hi, Some XHCI controllers e.g. dwc3 based have a broken Port disable [1]. If the attached high-speed device is misbehaving, the USB stack typically

[PATCH 06/11] xhci: Handle command completion and timeout race

2017-01-03 Thread Mathias Nyman
If we get a command completion event at the same time as the command timeout work starts on another cpu we might end up aborting the wrong command. If the command completion takes the xhci lock before the timeout work, it will handle the command, pick the next command, mark it as current_cmd, and

[PATCH 07/11] usb: xhci: hold lock over xhci_abort_cmd_ring()

2017-01-03 Thread Mathias Nyman
From: Lu Baolu In command timer function, xhci_handle_command_timeout(), xhci->lock is unlocked before call into xhci_abort_cmd_ring(). This might cause race between the timer function and the event handler. The xhci_abort_cmd_ring() function sets the CMD_RING_ABORT

[PATCH 03/11] usb: return error code when platform_get_irq fails

2017-01-03 Thread Mathias Nyman
From: Pan Bian In function xhci_mtk_probe(), variable ret takes the return value. Its value should be negative on failures. However, when the call to function platform_get_irq() fails, it does not set the error code, and 0 will be returned. 0 indicates no error. As a result,

[PATCH 04/11] usb: xhci: fix possible wild pointer

2017-01-03 Thread Mathias Nyman
From: Lu Baolu handle_cmd_completion() frees a command structure which might be still referenced by xhci->current_cmd. This might cause problem when xhci->current_cmd is accessed after that. A real-life case could be like this. The host takes a very long time to

[PATCH 09/11] xhci: Fix race related to abort operation

2017-01-03 Thread Mathias Nyman
From: OGAWA Hirofumi Current abort operation has race. xhci_handle_command_timeout() xhci_abort_cmd_ring() xhci_write_64(CMD_RING_ABORT) xhci_handshake(5s) do { check CMD_RING_RUNNING udelay(1)

[PATCH 02/11] usb: xhci: fix return value of xhci_setup_device()

2017-01-03 Thread Mathias Nyman
From: Lu Baolu xhci_setup_device() should return failure with correct error number when xhci host has died, removed or halted. During usb device enumeration, if usb host is not accessible (died, removed or halted), the hc_driver->address_device() should return a

Re: [PATCH 00/16] musb fixes for v4.10-rc3

2017-01-03 Thread Greg KH
On Tue, Jan 03, 2017 at 10:01:43AM -0600, Bin Liu wrote: > On Tue, Jan 03, 2017 at 04:38:47PM +0100, Greg KH wrote: > > On Tue, Jan 03, 2017 at 09:15:05AM -0600, Bin Liu wrote: > > > Hi Greg, > > > > > > These are musb fixes for v4.10-rc3, which fix the bugs in musb core and > > > some glue

[PATCH 08/11] xhci: Use delayed_work instead of timer for command timeout

2017-01-03 Thread Mathias Nyman
From: OGAWA Hirofumi This is preparation to fix abort operation race (See "xhci: Fix race related to abort operation"). To make timeout sleepable, use delayed_work instead of timer. [change a newly added pending timer fix to pending work -Mathias] Signed-off-by:

[PATCH 01/11] xhci: free xhci virtual devices with leaf nodes first

2017-01-03 Thread Mathias Nyman
the tt_info provided by a HS hub might be in use to by a child device Make sure we free the devices in the correct order. This is needed in special cases such as when xhci controller is reset when resuming from hibernate, and all virt_devices are freed. Also free the virt_devices starting from

[PATCH 00/11] xhci fixes for usb-linus

2017-01-03 Thread Mathias Nyman
Hi Greg These xhci fixes for usb-linus are mostly related to solving race issues found when commands time out. i.e. host or device is behaving baldy and we need to clean things up. -Mathias Baolin Wang (1): usb: host: xhci: Fix possible wild pointer when handling abort command Felipe Balbi

Re: [PATCH 01/24] USB: serial: cyberjack: fix NULL-deref at open

2017-01-03 Thread Greg KH
On Tue, Jan 03, 2017 at 04:39:40PM +0100, Johan Hovold wrote: > Fix NULL-pointer dereference when clearing halt at open should the device > lack a bulk-out endpoint. > > Unable to handle kernel NULL pointer dereference at virtual address 0030 > ... > PC is at cyberjack_open+0x40/0x9c

Re: [PATCH 01/16] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Greg KH
On Tue, Jan 03, 2017 at 09:47:47AM -0600, Bin Liu wrote: > On Tue, Jan 03, 2017 at 04:34:48PM +0100, Greg KH wrote: > > On Tue, Jan 03, 2017 at 09:15:06AM -0600, Bin Liu wrote: > > > During dma teardown for dequque urb, musb might generate bogus rx ep > > > interrupt even when the rx fifo is

[PATCH 05/11] usb: host: xhci: Fix possible wild pointer when handling abort command

2017-01-03 Thread Mathias Nyman
From: Baolin Wang When current command was supposed to be aborted, host will free the command in handle_cmd_completion() function. But it might be still referenced by xhci->current_cmd, which need to set NULL. Cc: Signed-off-by: Baolin Wang

[PATCH 11/11] usb: host: xhci: handle COMP_STOP from SETUP phase too

2017-01-03 Thread Mathias Nyman
From: Felipe Balbi Stop Endpoint command can come at any point and we have no control of that. We should make sure to handle COMP_STOP on SETUP phase as well, otherwise urb->actual_length might be set to negative values in some occasions such as below: urb->length

[PATCH 10/11] usb: xhci: apply XHCI_PME_STUCK_QUIRK to Intel Apollo Lake

2017-01-03 Thread Mathias Nyman
From: Wan Ahmad Zainie Intel Apollo Lake also requires XHCI_PME_STUCK_QUIRK. Adding its PCI ID to quirk. Cc: Signed-off-by: Wan Ahmad Zainie Signed-off-by: Mathias Nyman

Re: [PATCH 02/16] usb: musb: dsps: implement clear_ep_rxintr() callback

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 04:35:38PM +0100, Greg KH wrote: > On Tue, Jan 03, 2017 at 09:15:07AM -0600, Bin Liu wrote: > > This is for avoiding rx ep bogus interrupt during CPPI channel teardown. > > This is one of the worse changelog texts ever... > > Hint, don't use "This" :) > > And the text

[PATCH 01/24] USB: serial: cyberjack: fix NULL-deref at open

2017-01-03 Thread Johan Hovold
Fix NULL-pointer dereference when clearing halt at open should the device lack a bulk-out endpoint. Unable to handle kernel NULL pointer dereference at virtual address 0030 ... PC is at cyberjack_open+0x40/0x9c [cyberjack] Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable

Re: [PATCH 00/16] musb fixes for v4.10-rc3

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 04:38:47PM +0100, Greg KH wrote: > On Tue, Jan 03, 2017 at 09:15:05AM -0600, Bin Liu wrote: > > Hi Greg, > > > > These are musb fixes for v4.10-rc3, which fix the bugs in musb core and > > some glue layers for some use cases, such as bogus interrupts while musb > > in

Re: Oops with dwc3 in device mode and functionfs

2017-01-03 Thread Andy Shevchenko
On Tue, 2017-01-03 at 17:00 +0200, Andy Shevchenko wrote: > On Tue, 2017-01-03 at 15:49 +0100, Vincent Pelletier wrote: > > Hello, > > > > I am hitting the following oops with 4.10-rc2 (on an intel edison, > > so > > this is with Andy's patchset[1] which is currently based on 4.10-rc2 > > and

Re: [PATCH 01/16] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Bin Liu
On Tue, Jan 03, 2017 at 04:34:48PM +0100, Greg KH wrote: > On Tue, Jan 03, 2017 at 09:15:06AM -0600, Bin Liu wrote: > > During dma teardown for dequque urb, musb might generate bogus rx ep > > interrupt even when the rx fifo is flushed. As mentioned in the current > > inline comment, clearing ep

Re: [PATCH 00/16] musb fixes for v4.10-rc3

2017-01-03 Thread Greg KH
On Tue, Jan 03, 2017 at 09:15:05AM -0600, Bin Liu wrote: > Hi Greg, > > These are musb fixes for v4.10-rc3, which fix the bugs in musb core and > some glue layers for some use cases, such as bogus interrupts while musb > in heavy load, WARINING while rmmod omap2430 glue, and a few fixes in PM, >

Re: Thunderbolt adapter fails to instantiate USB and device enumeration if already connected at boot time

2017-01-03 Thread Chris Murphy
On Tue, Jan 3, 2017 at 2:28 AM, Oliver Neukum wrote: > On Mon, 2017-01-02 at 14:45 -0700, Chris Murphy wrote: >> I see these lines in the problem case, which don't occur in the >> working case. >> >> [0.561046] pci_bus :37: busn_res: [bus 37-ff] end is updated >> to 37

[PATCH 24/24] USB: serial: ti_usb_3410_5052: fix NULL-deref at open

2017-01-03 Thread Johan Hovold
Fix NULL-pointer dereference in open() should a malicious device lack the expected endpoints: Unable to handle kernel NULL pointer dereference at virtual address 0030 .. [] (ti_open [ti_usb_3410_5052]) from [] (serial_port_activate+0x68/0x98 [usbserial]) Fixes: 1da177e4c3f4

[PATCH 23/24] USB: serial: spcp8x5: fix NULL-deref at open

2017-01-03 Thread Johan Hovold
Fix NULL-pointer dereference in open() should the device lack the expected endpoints: Unable to handle kernel NULL pointer dereference at virtual address 0030 ... PC is at spcp8x5_open+0x30/0xd0 [spcp8x5] Fixes: 619a6f1d1423 ("USB: add usb-serial spcp8x5 driver") Cc: stable

[PATCH 08/24] USB: serial: iuu_phoenix: fix NULL-deref at open

2017-01-03 Thread Johan Hovold
Fix NULL-pointer dereference at open should the device lack a bulk-in or bulk-out endpoint: Unable to handle kernel NULL pointer dereference at virtual address 0030 ... PC is at iuu_open+0x78/0x59c [iuu_phoenix] Fixes: 07c3b1a10016 ("USB: remove broken usb-serial num_endpoints check") Cc:

[PATCH 03/24] USB: serial: io_edgeport: fix NULL-deref at open

2017-01-03 Thread Johan Hovold
Fix NULL-pointer dereference when initialising URBs at open should a non-EPIC device lack a bulk-in or interrupt-in endpoint. Unable to handle kernel NULL pointer dereference at virtual address 0028 ... PC is at edge_open+0x24c/0x3e8 [io_edgeport] Note that the EPIC-device probe path has the

Re: [PATCH 02/16] usb: musb: dsps: implement clear_ep_rxintr() callback

2017-01-03 Thread Greg KH
On Tue, Jan 03, 2017 at 09:15:07AM -0600, Bin Liu wrote: > This is for avoiding rx ep bogus interrupt during CPPI channel teardown. This is one of the worse changelog texts ever... Hint, don't use "This" :) And the text doesn't seem to describe this very well... thanks, greg k-h -- To

[PATCH 06/24] USB: serial: io_ti: fix I/O after disconnect

2017-01-03 Thread Johan Hovold
Cancel the heartbeat work on driver unbind in order to avoid I/O after disconnect in case the port is held open. Note that the cancel in release() is still needed to stop the heartbeat after late probe errors. Fixes: 26c78daade0f ("USB: io_ti: Add heartbeat to keep idle EP/416 ports from

[PATCH 00/24] USB: serial: fix NULL-derefs on missing endpoints

2017-01-03 Thread Johan Hovold
This series fixes a number of long-standing issues in various USB-serial drivers which would lead to crashes should a malicious device lack the expected endpoints. Included are also a few related fixes, and a couple of unrelated ones that were found during my survey (e.g. a memleak and a

[PATCH 02/24] USB: serial: garmin_gps: fix memory leak on failed URB submit

2017-01-03 Thread Johan Hovold
Make sure to free the URB transfer buffer in case submission fails (e.g. due to a disconnect). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable Signed-off-by: Johan Hovold --- drivers/usb/serial/garmin_gps.c | 1 + 1 file changed, 1 insertion(+)

[PATCH 21/24] USB: serial: pl2303: fix NULL-deref at open

2017-01-03 Thread Johan Hovold
Fix NULL-pointer dereference in open() should a type-0 or type-1 device lack the expected endpoints: Unable to handle kernel NULL pointer dereference at virtual address 0030 ... PC is at pl2303_open+0x38/0xec [pl2303] Note that a missing interrupt-in endpoint would have caused open() to

Re: [PATCH 01/16] usb: musb: core: add clear_ep_rxintr() to musb_platform_ops

2017-01-03 Thread Greg KH
On Tue, Jan 03, 2017 at 09:15:06AM -0600, Bin Liu wrote: > During dma teardown for dequque urb, musb might generate bogus rx ep > interrupt even when the rx fifo is flushed. As mentioned in the current > inline comment, clearing ep interrupt in the teardown path avoids the > bogus interrupt. > >

  1   2   >