[PATCH 5/5] usb: host: xhci: use slightly better list helpers

2016-11-29 Thread Felipe Balbi
Replace list_entry() with list_first_entry() and list_for_each() with list_for_each_entry(). This makes the code slightly more readable. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host

Re: XHCI's lock usage on hardirq handler

2016-11-29 Thread Felipe Balbi
Hi, Greg KH writes: > On Tue, Nov 29, 2016 at 01:48:59PM +0200, Felipe Balbi wrote: >> >> Hi folks, >> >> I've been staring at this part of the code for a while. To make things >> easier here's the part of XHCI I mean: >> >> > irqre

Re: XHCI's lock usage on hardirq handler

2016-11-29 Thread Felipe Balbi
Hi Greg, Greg KH writes: > On Tue, Nov 29, 2016 at 03:58:57PM +0200, Felipe Balbi wrote: >> >> Hi, >> >> Greg KH writes: >> > On Tue, Nov 29, 2016 at 01:48:59PM +0200, Felipe Balbi wrote: >> >> >> >> Hi folks, >> >>

Re: XHCI's lock usage on hardirq handler

2016-11-29 Thread Felipe Balbi
Hi, Alan Stern writes: > On Tue, 29 Nov 2016, Felipe Balbi wrote: > >> Hi Greg, >> >> Greg KH writes: >> > On Tue, Nov 29, 2016 at 03:58:57PM +0200, Felipe Balbi wrote: >> >> >> >> Hi, >> >> >> >> Greg

Re: [PATCH 06/12] usb: dwc3: omap: Replace the extcon API

2016-11-30 Thread Felipe Balbi
Hi, Chanwoo Choi writes: > This patch uses the resource-managed extcon API for extcon_register_notifier() > and replaces the deprecated extcon API as following: > - extcon_get_cable_state_() -> extcon_get_state() > > Signed-off-by: Chanwoo Choi Acked-by: Felipe

Re: [PATCH 2/2] Synopsys USB 2.0 Device Controller (UDC) Driver

2016-11-30 Thread Felipe Balbi
Hi, Raviteja Garimella writes: > This is driver for Synopsys Designware Cores USB Device > Controller (UDC) Subsystem with the AMBA Advanced High-Performance > Bus (AHB). This driver works with Synopsys UDC20 products. > > Signed-off-by: Raviteja Garimella use drivers/usb/dwc2 instead of dupli

Re: [PATCH 08/12] usb: phy: msm: Replace the extcon API

2016-11-30 Thread Felipe Balbi
Hi, Chanwoo Choi writes: > This patch uses the resource-managed extcon API for extcon_register_notifier() > and replaces the deprecated extcon API as following: > - extcon_get_cable_state_() -> extcon_get_state() > > Signed-off-by: Chanwoo Choi Acked-by: Felipe

Re: [PATCH 11/12] usb: phy: tahvo: Replace the deprecated extcon API

2016-11-30 Thread Felipe Balbi
Hi, Chanwoo Choi writes: > This patch replaces the deprecated extcon API as following: > - extcon_set_cable_state_() -> extcon_set_state_sync() > > Signed-off-by: Chanwoo Choi Acked-by: Felipe Balbi -- balbi signature.asc Description: PGP signature

Re: [PATCH 09/12] usb: phy: omap-otg: Replace the extcon API

2016-11-30 Thread Felipe Balbi
Hi, Chanwoo Choi writes: > This patch uses the resource-managed extcon API for extcon_register_notifier() > and replaces the deprecated extcon API as following: > - extcon_get_cable_state_() -> extcon_get_state() > > Signed-off-by: Chanwoo Choi Acked-by: Felipe

Re: [PATCH 10/12] usb: phy: qcom-8x16-usb: Replace the extcon API

2016-11-30 Thread Felipe Balbi
Hi, Chanwoo Choi writes: > This patch uses the resource-managed extcon API for extcon_register_notifier() > and replaces the deprecated extcon API as following: > - extcon_get_cable_state_() -> extcon_get_state() > > Signed-off-by: Chanwoo Choi Acked-by: Felipe

Re: [PATCH 12/12] usb: renesas_usbhs: Replace the deprecated extcon API

2016-11-30 Thread Felipe Balbi
Hi, Chanwoo Choi writes: > This patch replaces the deprecated extcon API as following: > - extcon_get_cable_state_() -> extcon_get_state() > > Signed-off-by: Chanwoo Choi Acked-by: Felipe Balbi -- balbi signature.asc Description: PGP signature

Re: [PATCH v2 2/4] usb: host: xhci: handle COMP_STOP from SETUP phase too

2016-11-30 Thread Felipe Balbi
Hi, Felipe Balbi writes: > 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: &g

Re: [PATCH 2/2] Synopsys USB 2.0 Device Controller (UDC) Driver

2016-11-30 Thread Felipe Balbi
Hi, Raviteja Garimella writes: > Hi Balbi, > > On Wed, Nov 30, 2016 at 4:10 PM, Felipe Balbi wrote: >> >> Hi, >> >> Raviteja Garimella writes: >>> This is driver for Synopsys Designware Cores USB Device >>> Controller (UDC) Subsystem with the

Re: [PATCH 2/2] Synopsys USB 2.0 Device Controller (UDC) Driver

2016-12-01 Thread Felipe Balbi
Hi, John Youn writes: > On 11/30/2016 4:47 AM, Felipe Balbi wrote: >> >> Hi, >> >> Raviteja Garimella writes: >>> Hi Balbi, >>> >>> On Wed, Nov 30, 2016 at 4:10 PM, Felipe Balbi wrote: >>>> >>>> Hi, >>>&g

[PATCH 00/25] usb: host: xhci: cleanup series

2016-12-01 Thread Felipe Balbi
e can assume this function to be always correct, there's no need to add debugging messages to it and as for the trb_in_td() call which existed only for debugging purposes, I guess we need to find a better way of adding debug statements for that part of the code. Let me know what you think. chee

[PATCH 03/25] usb: host: xhci: change pre-increments to post-increments

2016-12-01 Thread Felipe Balbi
This is a cleanup patch only, no functional changes. The idea is just to make sure for loops look the same all over the driver. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-dbg.c | 20 ++-- drivers/usb/host/xhci-mem.c | 10 +- drivers/usb/host/xhci.c | 14

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

2016-12-01 Thread Felipe Balbi
re to use TRB_TYPE field of the actual TRB instead of matching pointers to figure out in which stage of the control transfer we got our completion event. Signed-off-by: Felipe Balbi --- changes since v1 o handle multi-trb Data Stage --- drivers/usb/hos

[PATCH 04/25] usb: host: xhci: print HCIVERSION on debug

2016-12-01 Thread Felipe Balbi
When calling xhci_dbg_regs() we actually _do_ want to know XHCI's version. This might help figure out why certain problems only happen in some cases. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-dbg.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/host/xhci-db

[PATCH 01/25] usb: host: xhci: dynamically allocate devs array

2016-12-01 Thread Felipe Balbi
Instead of always defaulting to a 256-entry array, we can dynamically allocate devs based on what HW tells us it supports. Note that we can't, yet, purge MAX_HC_SLOTS completely because of struct xhci_device_context_array reliance on it. Signed-off-by: Felipe Balbi --- drivers/usb/host

[PATCH 05/25] usb: host: xhci: rename completion codes to match spec

2016-12-01 Thread Felipe Balbi
Cleanup only. This patch is a mechaninal rename to make sure our macros for TRB completion codes match what the specification uses to refer to such errors. The idea behind this is that it makes it far easier to grep the specification and match it with implementation. Signed-off-by: Felipe Balbi

[PATCH 06/25] usb: host: xhci: WARN on unexpected COMP_SUCCESS

2016-12-01 Thread Felipe Balbi
COMP_SUCCESS should only be asserted on a *true* sucessful transfer. Any other cases are bogus and we should aim to catch them. One easy way to get bug reports is to trigger a WARN_ONCE() on such cases. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 28

[PATCH 12/25] usb: host: xhci: major rewrite of process_ctrl_td()

2016-12-01 Thread Felipe Balbi
al of duplicated work done in both process_ctrl_td() and finish_td(). By removing the duplicated code, we could remove a few local variables and shuffle things around so the implementation is more straight forward. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c

[PATCH 07/25] usb: host: xhci: WARN() if we interrupt without event_ring

2016-12-01 Thread Felipe Balbi
7;re happy that this doesn't happen, we should just remove this altogether. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 772e07e2ef16..

[PATCH 09/25] usb: host: xhci: clear only STS_EINT

2016-12-01 Thread Felipe Balbi
Many other bits in USBSTS register are "clear-by-writing-1". Let's make sure that we clear *only* STS_EINT and not any of the other bits as they might be needed later. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 3 +-- 1 file changed, 1 insertion(+), 2 del

[PATCH 08/25] usb: host: xhci: simplify irq handler return

2016-12-01 Thread Felipe Balbi
Instead of having several return points, let's use a local variable and a single place to return. This makes the code slightly easier to read. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 31 --- 1 file changed, 16 insertions(+), 15 dele

[PATCH 10/25] usb: host: xhci: remove unneded semicolon

2016-12-01 Thread Felipe Balbi
it does no good, let's remove it. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ext-caps.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-ext-caps.h b/drivers/usb/host/xhci-ext-caps.h index e0244fb3903d..28deea584884 100644 --- a/driver

[PATCH 14/25] usb: host: xhci: cleanup finish_td()

2016-12-01 Thread Felipe Balbi
Now that finish_td() is the only place calling xhci_requires_manual_halt_cleanup() we can remove that function and use that to cleanup finish_td() by converting it into a switch statement using trb_comp_code. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 59

[PATCH 13/25] usb: host: xhci: major rewrite of process_bulk_intr_td()

2016-12-01 Thread Felipe Balbi
. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 52 +++- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 607bd2d2ab11..49712beef328 100644 --- a/drivers/usb/host

[PATCH 11/25] usb: host: xhci: use slightly better list helpers

2016-12-01 Thread Felipe Balbi
Replace list_entry() with list_first_entry() and list_for_each() with list_for_each_entry(). This makes the code slightly more readable. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host

[PATCH 21/25] usb: host: xhci: remove debug argument from trb_in_td()

2016-12-01 Thread Felipe Balbi
By just replacing xhci_warn() with xhci_dbg() we can get rid of the extra argument. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-mem.c | 5 ++--- drivers/usb/host/xhci-ring.c | 10 -- drivers/usb/host/xhci.h | 2 +- 3 files changed, 7 insertions(+), 10 deletions

[PATCH 17/25] usb: host: xhci: remove bogus __releases()/__acquires() annotation

2016-12-01 Thread Felipe Balbi
handle_tx_event() is not releasing xhci->lock nor reacquiring it, remove the bogus annotation. Signed-off-by: Felipe Balbi --- 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 f189c49f4

[PATCH 19/25] usb: host: xhci: unconditionally call xhci_unmap_td_bounce_buffer()

2016-12-01 Thread Felipe Balbi
xhci_unmap_td_bounce_buffer() already checks for a valid td->bounce_seg and bails out early if that's invalid. There's no need to check for this twice. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-)

[PATCH 23/25] usb: host: xhci: introduce helper to convert a single TRB in no-op

2016-12-01 Thread Felipe Balbi
this will be used in several places to convert a single TRB into No-Op. No functional changes in this patch. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/usb/host/xhci

[RFC/PATCH 25/25] usb: xhci: host: simplify implementation of trb_in_td()

2016-12-01 Thread Felipe Balbi
in_td() and xhci_check_trb_in_td_math() because we can assume those will always work. While at that, also remove two calls for trb_in_td() which existed for the sole purpose of printing out debugging messages!! Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-mem.c

[PATCH 15/25] usb: host: xhci: reorder variable definitions

2016-12-01 Thread Felipe Balbi
no functional changes. Simple cleanup to make sure variables are ordered in a 'reverse christmas tree' fashion. While at that, also remove an obsolete comment which doesn't apply anymore. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 12 1

[PATCH 18/25] usb: host: xhci: check for a valid ring when unmapping bounce buffer

2016-12-01 Thread Felipe Balbi
This way we can remove checks for valid ring from call sites of xhci_unmap_td_bounce_buffer() Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index

[PATCH 20/25] usb: host: xhci: don't try to mask critical errors

2016-12-01 Thread Felipe Balbi
Instead of fixing actual_length and setting status to 0, let's make sure the error is propagated and we print a big scary stack trace so errors are reported and we have a chance of fixing them. While at that, also remove unnecessary initialization of urb variable. Signed-off-by: Felipe

[PATCH 24/25] usb: host: xhci: use trb_to_noop() from xhci_handle_stopped_cmd_ring()

2016-12-01 Thread Felipe Balbi
instead of open coding how to convert a TRB to no-op, let's use our newly introduced helper. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-r

[PATCH 16/25] usb: host: xhci: introduce xhci_td_cleanup()

2016-12-01 Thread Felipe Balbi
By extracting xhci_td_cleanup() from finish_td(), code before clearer and easier to follow. There are no functional changes with this patch. It's merely a cleanup. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 92 1 file change

[PATCH 22/25] usb: host: xhci: remove unnecessary list_for_each_entry_safe()

2016-12-01 Thread Felipe Balbi
igned-off-by: Felipe Balbi --- drivers/usb/host/xhci-ring.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 50244dee6b43..ebb52ffab805 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/driver

Re: XHCI controller does not detect USB key insertion

2016-12-02 Thread Felipe Balbi
Hi, Mason writes: > Hello everyone, > > I'm trying out a SoC with a brand new USB controller, which is (supposedly) > a standard XHCI controller. In theory, I would just need to build the right > driver, and everything would auto-magically work, right? perhaps, but there might be needed initial

Re: [PATCH 06/12] usb: dwc3: omap: Replace the extcon API

2016-12-02 Thread Felipe Balbi
Hi, Chanwoo Choi writes: > Hi Felipe, > > On 2016년 11월 30일 19:36, Felipe Balbi wrote: >> >> Hi, >> >> Chanwoo Choi writes: >>> This patch uses the resource-managed extcon API for >>> extcon_register_notifier() >

Re: [PATCH 1/2] USB: turn off padding of resume time delays

2016-12-05 Thread Felipe Balbi
Hi, Todd Brandt writes: > Add a module parameter that replaces the USB_RESUME_TIMEOUT > and other hardcoded delay numbers with the USB spec minimums. > By default the patch retains the current values. > > The USB subsystem currently uses heavily padded values for TDRSMDN > and TRSTRCY. This patc

RE: USB3.0 DWC3 can't work with latest Linux-4.9.rc7

2016-12-05 Thread Felipe Balbi
(no top-posting, please) Hi, it helps if you include maintainers for correct drivers. scripts/get_maintainer.pl helps a lot. Jerry Huang writes: > And I tested USB2.0 disk, with Sriram's 6 patches, it works well. So Just > USB3.0 can't work. > > BTW, > The board with USB3.0 DWC3 controller a

RE: USB3.0 DWC3 can't work with latest Linux-4.9.rc7

2016-12-07 Thread Felipe Balbi
b 4-1: device descriptor read/8, error -61 > > So, how to handle this issue? oh, it's the DMA thing. We have patches going to next for this. Arnd, do you know if next has all missing pieces? There was something pending on XHCI IIRC, right? (keeping context below) &g

RE: USB3.0 DWC3 can't work with latest Linux-4.9.rc7

2016-12-07 Thread Felipe Balbi
Hi, Jerry Huang writes: >> Jerry Huang writes: >> > Hi, Balbi, >> > Sorry for later responding. >> > I tested Linux 4.8, 4.7, 4.6 and 4.5, has the same issue: >> > [0.756166] xhci-hcd: probe of xhci-hcd.0.auto failed with error -5 >> > >> > Then I found one patch (dwc3 initiated xhci probe

Re: [PATCH 00/25] usb: host: xhci: cleanup series

2016-12-07 Thread Felipe Balbi
Hi, Felipe Balbi writes: > hi Mathias, > > here's a much longer series of cleanups which I have been working on for > the past few days. Let me know what you think about it. > > I did some light tests SKL and everything still works as before. I know > you have some res

Re: [PATCH 1/2] usb: dwc3: gadget: Fix full speed mode

2016-12-07 Thread Felipe Balbi
Hi, Roger Quadros writes: >>> Roger Quadros writes: DCFG.DEVSPD == 0x3 is not valid and we need to set DCFG.DEVSPD to 0x1 for full speed mode. >>> >>> seems like it has been made invalid somewhere between 1.73a and >>> 2.60a. Can you figure it out from Documentation why and when it wa

RE: USB3.0 DWC3 can't work with latest Linux-4.9.rc7

2016-12-07 Thread Felipe Balbi
Hi, Jerry Huang writes: >> Jerry Huang writes: >> >> Jerry Huang writes: >> >> > Hi, Balbi, >> >> > Sorry for later responding. >> >> > I tested Linux 4.8, 4.7, 4.6 and 4.5, has the same issue: >> >> > [0.756166] xhci-hcd: probe of xhci-hcd.0.auto failed with error -5 >> >> > >> >> > Then

Re: [PATCH v4 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-12-08 Thread Felipe Balbi
Hi, Baolin Wang writes: > Hi Felipe, > > On 28 November 2016 at 14:43, Baolin Wang wrote: >> For some mobile devices with strict power management, we also want to suspend >> the host when the slave is detached for power saving. Thus we add the host >> suspend/resume functions to support this re

Re: [PATCH] usb: dwc3: omap: Fix imprecise external abort and oops on boot

2016-12-08 Thread Felipe Balbi
Hi, Tony Lindgren writes: > Somehow starting with v4.9-rc7 there have been imprecise There's nothing touching dwc3 since v4.9-rc5. > external aborts on omap5-uevm dwc3 controller. I have not been > able to bisect what exactly triggered this as it does not always > happen. It seems that somethi

RE: USB3.0 DWC3 can't work with latest Linux-4.9.rc7

2016-12-08 Thread Felipe Balbi
Hi, Jerry Huang writes: [...] >> >> >> oh, it's the DMA thing. We have patches going to next for this. >> >> >> Arnd, do you know if next has all missing pieces? There was >> >> >> something pending on XHCI IIRC, right? >> >> > So, there are some patches for this issue? Where can I find it? I

RE: USB3.0 DWC3 can't work with latest Linux-4.9.rc7

2016-12-08 Thread Felipe Balbi
Hi, Jerry Huang writes: >> -Original Message- >> From: Felipe Balbi [mailto:felipe.ba...@linux.intel.com] >> Sent: Thursday, December 08, 2016 5:46 PM >> To: Jerry Huang ; st...@rowland.harvard.edu; >> linux-usb@vger.kernel.org; Mathias Nyman >>

Re: [PATCH v4 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-12-08 Thread Felipe Balbi
Hi, Baolin Wang writes: >>> On 28 November 2016 at 14:43, Baolin Wang wrote: For some mobile devices with strict power management, we also want to suspend the host when the slave is detached for power saving. Thus we add the host suspend/resume functions to support this req

Re: [PATCH] usb: dwc3: omap: Fix imprecise external abort and oops on boot

2016-12-08 Thread Felipe Balbi
Hi, Tony Lindgren writes: > * Felipe Balbi [161208 01:45]: >> >> Hi, >> >> Tony Lindgren writes: >> > Somehow starting with v4.9-rc7 there have been imprecise >> >> There's nothing touching dwc3 since v4.9-rc5. > > Right, not

Re: [PATCH v4 2/2] usb: dwc3: core: Support the dwc3 host suspend/resume

2016-12-08 Thread Felipe Balbi
Hi, Baolin Wang writes: >> Baolin Wang writes: > On 28 November 2016 at 14:43, Baolin Wang wrote: >> For some mobile devices with strict power management, we also want to >> suspend >> the host when the slave is detached for power saving. Thus we add the >> host >> su

Re: [PATCH] usb: dwc3: omap: Fix imprecise external abort and oops on boot

2016-12-08 Thread Felipe Balbi
Hi, Tony Lindgren writes: > * Felipe Balbi [161208 09:52]: >> >> Hi, >> >> Tony Lindgren writes: >> > * Felipe Balbi [161208 01:45]: >> >> >> >> Hi, >> >> >> >> Tony Lindgren writes: >> >>

Re: [PATCH] usb: dwc3: omap: Fix imprecise external abort and oops on boot

2016-12-08 Thread Felipe Balbi
Hi, Tony Lindgren writes: >> Is there also some dwc3 internal clock? If we assume the usb_otg_ss >> module is properly enabled it could be some dwc3 internal clock not >> enabled? >> >> We do have a srst_udelay needed for enabling musb controller for some >> SoCs, I'll check if that's the case

Re: [PATCH] usb: dwc3: omap: Fix imprecise external abort and oops on boot

2016-12-08 Thread Felipe Balbi
Hi, Tony Lindgren writes: >> nothing against it. Would be nice if TI could confirm this is needed and >> check if other families might also need it. > > But as we currently are not using the WRAPRESET bit, the reset > function is nop except for the delay. So this just papers over > the problem w

Re: [PATCH] usb: dwc3: omap: Fix imprecise external abort and oops on boot

2016-12-08 Thread Felipe Balbi
Hi, Tony Lindgren writes: > * Felipe Balbi [161208 11:17]: >> Tony Lindgren writes: >> > The call to pm_runtime_get_sync() in dwc3_omap_probe() will use it. >> >> right, but there's no runtime suspend until ->remove(). IOW, after >> pm_runtime_get

Re: Emulating USB devices from userspace

2016-12-09 Thread Felipe Balbi
Hi, Andrey Konovalov writes: > On Fri, Dec 9, 2016 at 8:20 AM, Greg Kroah-Hartman > wrote: >> On Fri, Dec 09, 2016 at 12:38:23AM +0100, Andrey Konovalov wrote: >>> Hi, >>> >>> I'm working on a way to extend syzkaller [1] to support fuzzing of the >>> USB subsystem. The idea is to be able to emu

Re: usb:xhci: support disable usb2 LPM Remote Wakeup

2016-12-12 Thread Felipe Balbi
Hi, "Thang Q. Nguyen" writes: > On Sat, Dec 10, 2016 at 4:36 AM, Rob Herring wrote: >> On Sun, Dec 04, 2016 at 07:42:01PM +0700, Thang Q. Nguyen wrote: >>> From: Thang Nguyen >>> >>> As per USB 2.0 link power management addendum ECN, table 1-2, page 4, >>> device or host initiated via resume s

RE: USB3.0 DWC3 can't work with latest Linux-4.9.rc7

2016-12-12 Thread Felipe Balbi
Hi, Jerry Huang writes: >> >> >> >> >> oh, it's the DMA thing. We have patches going to next for this. >> >> >> >> >> Arnd, do you know if next has all missing pieces? There was >> >> >> >> >> something pending on XHCI IIRC, right? >> >> >> >> > So, there are some patches for this issue? Where c

Re: Should xhci_irq() call usb_hc_died()?

2016-12-12 Thread Felipe Balbi
Hi, Bjorn Helgaas writes: > Hi Mathias, > > ehci_irq(), ohci_irq(), fotg210_irq(), and oxu210_hcd_irq() contain code > equivalent to this: > > status = ehci_readl(...); > if (status == ~(u32) 0) { > ... > usb_hc_died(hcd); > ... > return IRQ_HANDLED; > } > > xhci_irq() has

Re: [PATCH 1/2] usb: xhci: switch to running avg trb length

2016-12-13 Thread Felipe Balbi
Hi, Felipe Balbi writes: > It's unlikely that we will ever know the avg so > instead of assuming it'll be something really large, > we will calculate the avg as we go as mentioned in > XHCI specification section 4.14.1.1. > > Signed-off-by: Felipe Balbi ping?!?

Re: [PATCH 2/2] usb: xhci: mem: convert to a switch statement

2016-12-13 Thread Felipe Balbi
Hi, Felipe Balbi writes: > when getting endpoint type a switch statement looks > better than a series of if () branches. There are no > functional changes with this patch, cleanup only. > > Signed-off-by: Felipe Balbi ping here too. Any comments? -- balbi signature.asc D

[PATCH] usb: host: xhci: refactor xhci_hub_control()

2016-12-13 Thread Felipe Balbi
In order to make xhci_hub_control() easier to read, let's break it into smaller functions. This will aid maintainability and readability of the code. There are no functional changes here, just shuffling code around. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-hub.c

Re: [PATCH] usb: host: xhci: refactor xhci_hub_control()

2016-12-13 Thread Felipe Balbi
://github.com/0day-ci/linux/commits/Felipe-Balbi/usb-host-xhci-refactor-xhci_hub_control/20161213-192036 > base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git > usb-testing > config: blackfin-allmodconfig (attached as .config) > compiler: bfin-uclinux-gcc (GCC) 6.2

Re: dma-coherent and snooping set

2016-12-14 Thread Felipe Balbi
Hi, Jerry Huang writes: > hi, Balbi, > sorry to disturb you. > > some NXP platforms need dma-coherent property. > > I want to add "dma-coherent" into usb node in DTS file like other > platform done > (e.g. arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi). > > Could you please give some comme

RE: [PATCH] USB3/DWC3: Enable undefined length INCR burst type

2016-12-16 Thread Felipe Balbi
Hi, Jerry Huang writes: >> -Original Message- >> From: Changming Huang [mailto:jerry.hu...@nxp.com] >> Sent: Tuesday, December 13, 2016 5:06 PM >> To: ba...@kernel.org; gre...@linuxfoundation.org >> Cc: linux-usb@vger.kernel.org; linux-ker...@vger.kernel.org; Jerry Huang >> ; Rajesh Bhag

RE: [PATCH] USB3/DWC3: Enable undefined length INCR burst type

2016-12-16 Thread Felipe Balbi
Hi, Jerry Huang writes: >> there's no need for that. This patch is in good format. I do have a question, >> however: how do you know this will work for all users? Burst size is a >> function >> of how wide the interconnect where dwc3 is attached to, is. > So I need to generate one new property

[PATCH] usb: dwc3: pci: sometimes 'add' means 'set'

2016-12-16 Thread Felipe Balbi
Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/dwc3-pci.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 2b73339f286b..1eca4c543667 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/

RE: [PATCH] USB3/DWC3: Enable undefined length INCR burst type

2016-12-16 Thread Felipe Balbi
Hi, Jerry Huang writes: > Hi, Balbi, >> -Original Message- >> From: Felipe Balbi [mailto:ba...@kernel.org] >> Sent: Friday, December 16, 2016 7:44 PM >> To: Jerry Huang ; gre...@linuxfoundation.org >> Cc: linux-usb@vger.kernel.org; linux-ker.

RE: [PATCH] USB3/DWC3: Enable undefined length INCR burst type

2016-12-19 Thread Felipe Balbi
Hi, Jerry Huang writes: >> >> Jerry Huang writes: >> >> >> there's no need for that. This patch is in good format. I do have >> >> >> a question, >> >> >> however: how do you know this will work for all users? Burst size >> >> >> is a function of how wide the interconnect where dwc3 is attached

Re: [PATCH 2/2] usb: xhci: mem: convert to a switch statement

2016-12-19 Thread Felipe Balbi
Hi again, Felipe Balbi writes: > Hi, > > Felipe Balbi writes: >> when getting endpoint type a switch statement looks >> better than a series of if () branches. There are no >> functional changes with this patch, cleanup only. >> >> Signed-off-by: Felipe

Re: [PATCH 1/2] usb: xhci: switch to running avg trb length

2016-12-19 Thread Felipe Balbi
Hi, Felipe Balbi writes: > Hi, > > Felipe Balbi writes: >> It's unlikely that we will ever know the avg so >> instead of assuming it'll be something really large, >> we will calculate the avg as we go as mentioned in >> XHCI specification section

Re: [PATCH 1/2] usb: dwc3: gadget: Fix full speed mode

2016-12-20 Thread Felipe Balbi
Hi, John Youn writes: > On 12/7/2016 7:06 PM, John Youn wrote: >> On 12/7/2016 4:44 AM, Felipe Balbi wrote: >>> >>> Hi, >>> >>> Roger Quadros writes: >>>>>> Roger Quadros writes: >>>>>>> DCFG.DEVSPD =

Re: [PATCH 0/2] Intel cherrytrail xhci extended cap phy/mux support

2016-12-22 Thread Felipe Balbi
Hi, Hans de Goede writes: > Hi All, > > Here are 2 patches which can and should be merged separately, but > which do belong together, as together they add support for the > usb-phy / mux bits found in the Intel Cherrytrail xhci vendor defined > extended capabilities registers. > > I did not want

Re: [PATCH 0/2] Intel cherrytrail xhci extended cap phy/mux support

2016-12-22 Thread Felipe Balbi
Hi, Hans de Goede writes: >>> Here are 2 patches which can and should be merged separately, but >>> which do belong together, as together they add support for the >>> usb-phy / mux bits found in the Intel Cherrytrail xhci vendor defined >>> extended capabilities registers. >>> >>> I did not want

Re: DWC3 + g_ether: crash when qmult is increased

2016-12-23 Thread Felipe Balbi
Hi, Jean-Jacques Hiblot writes: > Hi Felipe, > > While trying out the v4.9 kernel on a DRA7x, I stumbled upon this > crash. I haven't tried to bisect yet and probably won't be do it > before next year. > > This crash doesn't occur with a 4.4 kernel. I suspect it has to do > with the changes in t

Re: DWC3 + ECM: performance regression

2016-12-23 Thread Felipe Balbi
Hi, Jean-Jacques Hiblot writes: > Hi Felipe, > > I noticed a performance regression with commit > fd9afd3cbe404998d732be6cc798f749597c5114 "usb: gadget: u_ether: remove > interrupt throttling". > > I read the discussion leading to this commit and I agree that the > interrupt throttling may no

Re: DWC3 + g_ether: crash when qmult is increased

2016-12-23 Thread Felipe Balbi
Hi, Felipe Balbi writes: > Hi, > > Jean-Jacques Hiblot writes: >> Hi Felipe, >> >> While trying out the v4.9 kernel on a DRA7x, I stumbled upon this >> crash. I haven't tried to bisect yet and probably won't be do it >> before next year. &g

Re: DWC3 + g_ether: crash when qmult is increased

2016-12-23 Thread Felipe Balbi
Hi, Jean-Jacques Hiblot writes: >>> Jean-Jacques Hiblot writes: Hi Felipe, While trying out the v4.9 kernel on a DRA7x, I stumbled upon this crash. I haven't tried to bisect yet and probably won't be do it before next year. This crash doesn't occur with a 4.4

Re: [PATCH] usb: dwc3: gadget: Avoid race between dwc3 interrupt handler and irq thread handler

2016-12-27 Thread Felipe Balbi
Hi, Lu Baolu writes: > On 12/26/2016 04:01 PM, Baolin Wang wrote: >> On some platfroms(like x86 platform), when one core is running the USB gadget >> irq thread handler by dwc3_thread_interrupt(), meanwhile another core also >> can >> respond other interrupts from dwc3 controller and modify the

Re: [PATCH] usb: dwc3: gadget: Avoid race between dwc3 interrupt handler and irq thread handler

2016-12-27 Thread Felipe Balbi
Hi, Janusz Dziedzic writes: > 2016-12-26 9:01 GMT+01:00 Baolin Wang : >> On some platfroms(like x86 platform), when one core is running the USB gadget >> irq thread handler by dwc3_thread_interrupt(), meanwhile another core also >> can >> respond other interrupts from dwc3 controller and modify

Re: [PATCH] usb: dwc3: gadget: Avoid race between dwc3 interrupt handler and irq thread handler

2016-12-27 Thread Felipe Balbi
Hi, Baolin Wang writes: > Hi, > > On 27 December 2016 at 18:52, Janusz Dziedzic > wrote: >> 2016-12-26 9:01 GMT+01:00 Baolin Wang : >>> On some platfroms(like x86 platform), when one core is running the USB >>> gadget >>> irq thread handler by dwc3_thread_interrupt(), meanwhile another core a

Re: [PATCH 1/2] usb: dwc3-pci: Fix dr_mode misspelling

2016-12-27 Thread Felipe Balbi
Hi, Hans de Goede writes: > usb_get_dr_mode() expects the device-property to be spelled > "dr_mode" not "dr-mode". > > Spelling it properly fixes the following warning showing up in dmesg: > [ 8704.500545] dwc3 dwc3.2.auto: Configuration mismatch. dr_mode forced to > gadget > > Signed-off-by: H

Re: [PATCH v2 RESEND] usb: gadget: udc-core: Rescan pending list on driver unbind

2016-12-27 Thread Felipe Balbi
Hi, Krzysztof Opasiak writes: > Since: > > commit 855ed04a3758 ("usb: gadget: udc-core: independent registration > of gadgets and gadget drivers") > > if we load gadget module but there is no free udc available > then it will be stored on a pending gadgets list. > > $ modprobe g_zero.ko > $ modp

Re: net/gadget: slab-out-of-bounds write in dev_config

2016-12-27 Thread Felipe Balbi
Hi, Alan Stern writes: > On Tue, 6 Dec 2016, Andrey Konovalov wrote: > >> Hi! >> >> I've got the following error report while running the syzkaller fuzzer. >> >> ep0_write() doesn't check the length, so a user can cause an >> out-of-bounds with both size and data controlled. >> There's a comme

Re: [PATCH] usb: mtu3: fix U3 port link issue

2016-12-27 Thread Felipe Balbi
Hi, Chunfeng Yun writes: > the issue is introduced when @is_u3_ip is used in mtu3_device_enabe() > before initialized in mtu3_mem_alloc(), so get global IP information > at first before used by following functins. > > Signed-off-by: Chunfeng Yun patch doesn't apply to my testing/fixes. Please

Re: [PATCH v2] usb: dwc3: pci: Add "linux,sysdev_is_parent" property

2016-12-27 Thread Felipe Balbi
Hi, John Youn writes: > Calling platform_device_add_properties() replaces existing properties so > the "linux,sysdev_is_parent" property doesn't get set. Add this property > to each platform. > > Fixes: d64ff406e51e ("usb: dwc3: use bus->sysdev for DMA configuration") > Signed-off-by: John Youn

Re: [PATCH 0/9] usb: dwc2: Fix checkpatch issues

2016-12-27 Thread Felipe Balbi
Hi John, John Youn writes: > The dwc2 driver triggers several hundred checkpatch warnings and > checks. None of them are actual problems but this is still very noisy. > This series fixes most of those issues. > > The first patch in the series is the result of running checkpatch with > '--fix'. A

Re: usb/gadget: warning in dummy_free_request

2016-12-27 Thread Felipe Balbi
Hi, Andrey Konovalov writes: > Hi! > > I've got the following error report while running the syzkaller fuzzer. > > On commit 3c49de52d5647cda8b42c4255cf8a29d1e22eff5 (Dec 2). > > WARNING: CPU: 0 PID: 5257 at drivers/usb/gadget/udc/dummy_hcd.c:672 > dummy_free_request+0x153/0x170 > Kernel panic -

[PATCH 3/3] usb: dwc3: core: avoid Overflow events

2016-12-27 Thread Felipe Balbi
avoid any future issues. Cc: # v4.9 Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 99fa8b8b06fe..3cc09542f32a 100644 --- a/drivers/usb/dwc3/core.h +++ b/driver

[PATCH 2/3] usb: dwc3: gadget: make use of No Response Update Transfer

2016-12-27 Thread Felipe Balbi
r commands to the endpoint straight away. Let's start using this version to skip the long-ish wait. Cc: # v4.9 Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.

[PATCH 1/3] usb: dwc3: gadget: properly check ep cmd

2016-12-27 Thread Felipe Balbi
. Cc: # v4.9 Reported-by: Janusz Dziedzic Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h | 2 ++ drivers/usb/dwc3/gadget.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 6b60e42626a2..99fa8b8b06fe 100644 --- a

[PATCH 3/3] usb: dwc3: gadget: always unmap EP0 requests

2016-12-27 Thread Felipe Balbi
ince those are *always* mapped. Fixes: 0416e494ce7d ("usb: dwc3: ep0: correct cache sync issue in case of ep0_bounced") Cc: Tested-by: Tomasz Medrek Reported-by: Janusz Dziedzic Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 8 1 file changed, 4 insert

[PATCH 1/3] usb: dwc3: ep0: add dwc3_ep0_prepare_one_trb()

2016-12-27 Thread Felipe Balbi
ep0: handle non maxpacket aligned transfers > 512") Cc: Reported-by: Janusz Dziedzic Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/ep0.c | 26 -- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 487

[PATCH 2/3] usb: dwc3: ep0: explicitly call dwc3_ep0_prepare_one_trb()

2016-12-27 Thread Felipe Balbi
anusz Dziedzic Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/ep0.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 06febd07ec4e..9bb1f8526f3e 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb

[PATCH] usb: dwc3: pci: add Intel Gemini Lake PCI ID

2016-12-27 Thread Felipe Balbi
From: Heikki Krogerus Intel Gemini Lake SoC has the same DWC3 than Broxton. Add the new ID to the supported Devices. Signed-off-by: Heikki Krogerus Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/dwc3-pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-pci.c b

<    3   4   5   6   7   8   9   10   11   12   >