[PATCH] usb: dwc3: trace: pretty-print TRB's ctrl field

2016-05-23 Thread Felipe Balbi
means that bit is set, while lowercase letter means bit is cleared. Signed-off-by: Janusz Dziedzic Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/trace.h | 40 ++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/trace.h b/drivers

Re: [PATCH 5/5] usb: dwc3: Endianness issue on dwc3_log_ctrl

2016-05-24 Thread Felipe Balbi
John Youn writes: > Sparse complains even though it looks ok. Probably it cannot detect that > the wValue, wIndex, and wLength are declared __le16 due to the macro > magic. should we fix sparse, instead? Oh well, doesn't hurt applying. > > Redeclare them as CPU endianness and make the conversion

Re: [PATCH v2 5/5] usb: dwc3: rockchip: add devicetree bindings documentation

2016-05-24 Thread Felipe Balbi
Hi, William Wu writes: > This patch documents the device tree documentation required for > Rockchip USB3.0 core wrapper consist of USB3.0 IP from Synopsys. > > It could operate in device mode (SS, HS, FS) and host > mode (SS, HS, FS, LS). > > Signed-off-by: William Wu > --- > Changes in v2: > -

Re: [PATCH v8 5/5] usb: dwc3: core: cleanup IRQ resources

2016-05-24 Thread Felipe Balbi
Hi, Roger Quadros writes: > Implementations might use different IRQs for > host, gadget and OTG so use named interrupt resources > to allow Device tree to specify the 3 interrupts. > > Following are the interrupt names > > Peripheral Interrupt - peripheral > HOST Interrupt - host > OTG Interrupt

Re: xhci DWC3 flavor problem

2016-05-24 Thread Felipe Balbi
Hi João, (please avoid top-posting ;) Joao Pinto writes: > Hi, > Just to give you an update. > All is working great, the cause was an FPGA configuration issue. > Thank you for your support. good to know :) -- balbi signature.asc Description: PGP signature

Re: [RFC PATCH] usb: gadget: Introduce Cadence USB2 UDC Driver

2016-05-24 Thread Felipe Balbi
Hi, (please break lines at 80-columns and don't top-post ;) Neil Armstrong writes: > [ Unknown signature status ] > Hi Felipe, Laurent, > > I submitted this driver for a Cadence IP library from a now abandoned > project. > > The driver was working on a SoC platform ported on a FPGA, but I do >

Re: [PATCH v2 5/5] usb: dwc3: rockchip: add devicetree bindings documentation

2016-05-25 Thread Felipe Balbi
Hi, William Wu writes: > Hi Felipe, > > On 05/24/2016 05:32 PM, Felipe Balbi wrote: >> Hi, >> >> William Wu writes: >>> This patch documents the device tree documentation required for >>> Rockchip USB3.0 core wrapper consist of USB3.0 IP from Syno

Re: [PATCH] dwc3: gadget: Introduce dwc3_endpoint_xfer_xxx() to check endpoint type

2016-05-25 Thread Felipe Balbi
Hi, Baolin Wang writes: > When handling the endpoint interrupt handler, it maybe disable the endpoint > from another core user to set the USB endpoint descriptor pointor to be NULL > while issuing usb_gadget_giveback_request() function to release lock. So it > will be one bug to check the endpoi

Re: [PATCH v2] usb: gadget: fix spinlock dead lock in gadgetfs

2016-05-25 Thread Felipe Balbi
Hi, Bin Liu writes: > On Wed, May 25, 2016 at 02:18:34PM -0500, Bin Liu wrote: >> [ 40.467381] = >> [ 40.473013] [ INFO: possible recursive locking detected ] >> [ 40.478651] 4.6.0-08691-g7f3db9a #37 Not tainted >> [ 40.483466]

Re: [PATCH] dwc3: gadget: Introduce dwc3_endpoint_xfer_xxx() to check endpoint type

2016-05-26 Thread Felipe Balbi
Hi, Baolin Wang writes: > Hi Felipe, > > On 26 May 2016 at 14:22, Felipe Balbi wrote: >> >> Hi, >> >> Baolin Wang writes: >>> When handling the endpoint interrupt handler, it maybe disable the endpoint >>> from another core user to set the U

Re: [PATCH] drivers: usb: dwc3 : Configure DMA properties and ops from DT

2016-05-26 Thread Felipe Balbi
Hi, Leo Li writes: >>> On certain platforms (e.g. ARM64) the dma_ops needs to be explicitly set >>> to be able to do DMA allocations, so use the of_dma_configure() helper >>> to populate the dma properties and assign an appropriate dma_ops. >>> >>> Signed-off-by: Rajesh Bhagat >>> Reviewed-by:

Re: [PATCH] dwc3: gadget: Introduce dwc3_endpoint_xfer_xxx() to check endpoint type

2016-05-26 Thread Felipe Balbi
Hi, Baolin Wang writes: >> Also note that the usb_endpoint_xfer_isoc() call on line 2067 of >> gadget.c (as in my testing/next from today) won't even get executed, so >> we're safe there. > > Never will be executed? then we can remove the > usb_endpoint_xfer_isoc() (line 2025) at risk? > > 20

Re: [PATCH] dwc3: gadget: Introduce dwc3_endpoint_xfer_xxx() to check endpoint type

2016-05-26 Thread Felipe Balbi
Hi, Baolin Wang writes: > On 26 May 2016 at 17:45, Felipe Balbi wrote: >> >> Hi, >> >> Baolin Wang writes: >> >> >> >>>> Also note that the usb_endpoint_xfer_isoc() call on line 2067 of >>>> gadget.c (as in my testi

Re: [RFC PATCH 5/6] xhci: align the last trb before link if it is easily splittable.

2016-05-26 Thread Felipe Balbi
Hi, Mathias Nyman writes: > diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c > index d86da81..c7c9521 100644 > --- a/drivers/usb/host/xhci-ring.c > +++ b/drivers/usb/host/xhci-ring.c > @@ -3098,6 +3098,27 @@ static u32 xhci_td_remainder(struct xhci_hcd *xhci, > int trans

Re: [RFC PATCH 5/6] xhci: align the last trb before link if it is easily splittable.

2016-05-26 Thread Felipe Balbi
Hi, Mathias Nyman writes: > TD fragments section 4.11.7.1 in xhci specs have additional requirements > on how trbs in TDs must be organized. > > TD fragments shall not span transfer ring segments and TD fragments must > be packet aligned. Normally we don't care about TD fragments, on TD is one >

Re: [RFC PATCH 6/6] xhci: TD-fragment, align the unsplittable case with a bounce buffer

2016-05-26 Thread Felipe Balbi
Hi, Mathias Nyman writes: > @@ -3098,24 +3136,66 @@ static u32 xhci_td_remainder(struct xhci_hcd *xhci, > int transferred, > return (total_packet_count - ((transferred + trb_buff_len) / maxp)); > } > > + > static int xhci_align_td(struct xhci_hcd *xhci, struct urb *urb, u32 > enqd_le

Re: [PATCH v2] usb: gadget: fix spinlock dead lock in gadgetfs

2016-05-26 Thread Felipe Balbi
>> Bin Liu writes: >> > On Wed, May 25, 2016 at 02:18:34PM -0500, Bin Liu wrote: >> >> [ 40.467381] = >> >> [ 40.473013] [ INFO: possible recursive locking detected ] >> >> [ 40.478651] 4.6.0-08691-g7f3db9a #37 Not tainted >> >> [ 40.483466] ---

Re: [PATCH v3 2/5] usb: dwc3: add dis_u2_freeclk_exists_quirk

2016-05-27 Thread Felipe Balbi
Hi, William Wu writes: > Add a quirk to clear the GUSB2PHYCFG.U2_FREECLK_EXISTS bit, > which specifies whether the USB2.0 PHY provides a free-running > PHY clock, which is active when the clock control input is active. > > Signed-off-by: William Wu can you rebase on top of my testing/next? We'

Re: [PATCH] dwc3-exynos: Fix deferred probing storm.

2016-05-27 Thread Felipe Balbi
Hi, Krzysztof Kozlowski writes: > On 05/27/2016 01:46 PM, Steinar H. Gunderson wrote: >> On Fri, May 27, 2016 at 03:23:35PM +0530, Vivek Gautam wrote: >>> I don't have any concerns with the patch apart from the ones >>> Krzysztof has already pointed out. >>> LGTM. >> >> Should I repost the patc

Re: [PATCH] dwc3-exynos: Fix deferred probing storm.

2016-05-27 Thread Felipe Balbi
Hi, "Steinar H. Gunderson" writes: > On Fri, May 27, 2016 at 04:12:59PM +0300, Felipe Balbi wrote: >> yes, please do that. Keep in mind, also, that we're still in the middle >> of the merge window and nothing will really happen until v4.7-rc1 is >> tagged.

Re: [PATCH] drivers: usb: dwc3 : Configure DMA properties and ops from DT

2016-05-27 Thread Felipe Balbi
Hi, Leo Li writes: >> Leo Li writes: > On certain platforms (e.g. ARM64) the dma_ops needs to be explicitly set > to be able to do DMA allocations, so use the of_dma_configure() helper > to populate the dma properties and assign an appropriate dma_ops. > > Signed-off-by: Raj

Re: [PATCH 11/22] usb: dwc3: gadget: clear LST from previous TRB on Update Transfer

2016-05-29 Thread Felipe Balbi
Hi Janusz, (good to see your email here) Janusz Dziedzic writes: > On 19 May 2016 at 09:08, Felipe Balbi wrote: >> >> Hi, >> >> Paul Zimmerman writes: >>> Felipe Balbi writes: >>> >>>> If we're going to issue a Update Transfer

Re: Support for Pravega USB3 controller

2016-05-30 Thread Felipe Balbi
Hi, Mason writes: > Hello everyone, > > I'm working on a SoC which embeds an IP block from GDA Technologies > labeled "Pravega USB3 SuperSpeed Controller" (data-sheet is v0.99r > dated 2014-01-29). A cursory search returns: > > http://www.sourcing.co.jp/prod_ip.htm > http://www.sourcing.co.jp/pr

Re: [PATCH 2/3] usb: dwc3: host: use build-in property instead of platform data

2016-05-30 Thread Felipe Balbi
Hi, Heikki Krogerus writes: > Hi Felipe, > > On Tue, Apr 19, 2016 at 02:10:45PM +0300, Heikki Krogerus wrote: >> This should allow xhci to remove handling of platform data. >> >> Signed-off-by: Heikki Krogerus >> Cc: Felipe Balbi > > Is this OK n

Re: Support for Pravega USB3 controller

2016-05-30 Thread Felipe Balbi
Hi, Mason writes: > Hello Felipe, > > On 30/05/2016 08:58, Felipe Balbi wrote: > >> Mason writes: >> >>> I'm working on a SoC which embeds an IP block from GDA Technologies >>> labeled "Pravega USB3 SuperSpeed Controller" (data-sheet

Re: [PATCH 2/3] usb: dwc3: host: use build-in property instead of platform data

2016-05-30 Thread Felipe Balbi
Hi, Heikki Krogerus writes: > On Mon, May 30, 2016 at 11:12:40AM +0300, Felipe Balbi wrote: >> >> Hi, >> >> Heikki Krogerus writes: >> > Hi Felipe, >> > >> > On Tue, Apr 19, 2016 at 02:10:45PM +0300, Heikki Krogerus wrote: >> &

[PATCH 01/62] usb: gadget: storage: get rid of fsg_num_buffers_validate()

2016-05-30 Thread Felipe Balbi
valid range for storage buffers is encoded in Kconfig already. Instead of checking again, let's drop fsg_num_buffers_validate() altogether. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/function/f_mass_storage.c | 22 +- 1 file changed, 1 insertion(+), 21 dele

[PATCH 00/62] usb: pending patches on testing/next

2016-05-30 Thread Felipe Balbi
I have on testing/next and really report problems. For PM runtime, if anybody has issues, I guess I can keep it enabled but forbidden so users have to echo "auto" > //power/control But, hey, PM runtime is working fine for me here. Again, sorry for the patch bomb folks :-s

[PATCH 11/62] usb: dwc3: gadget: return 0 if we try to Wakeup in superspeed

2016-05-30 Thread Felipe Balbi
with LPM enabled. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index db7bbbd0cecd..eca131f0be59 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/

[PATCH 18/62] usb: dwc3: core: simplify suspend/resume operations

2016-05-30 Thread Felipe Balbi
now that we have re-factored dwc3_core_init() and dwc3_core_exit() we can use them for suspend/resume operations. This will help us avoid some common mistakes when patching code when we have duplicated pieces of code doing the same thing. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.c

[PATCH 08/62] usb: dwc3: gadget: simplify __dwc3_gadget_kick_transfer()

2016-05-30 Thread Felipe Balbi
as it turns out, we don't need the extra 'start_new' argument as that can be inferred from DWC3_EP_BUSY flag. Because of that, we can simplify __dwc3_gadget_kick_transfer() by quite a bit, even allowing us to prepare more TRBs unconditionally. Signed-off-by: Felipe Balbi --- d

[PATCH 10/62] usb: dwc3: gadget: remove udelay(1) when sending ep cmds

2016-05-30 Thread Felipe Balbi
When we send an endpoint command, we want that to complete as soon as possible, so let's remove the unnecessary udelay(1) call. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gad

[PATCH 06/62] usb: dwc3: core: get rid of DWC3_PM_OPS macro

2016-05-30 Thread Felipe Balbi
that macro is unnecessary and just adds pointless obfuscation. Let's remove it. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index a590cd225bb7..245f4ff

[PATCH 14/62] usb: dwc3: gadget: pass dep as argument to endpoint command

2016-05-30 Thread Felipe Balbi
umber]; to just passing struct dwc3_ep *dep as argument. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h | 8 drivers/usb/dwc3/ep0.c| 5 ++--- drivers/usb/dwc3/gadget.c | 33 + 3 files changed, 23 insertions(+), 23 deletions(-) diff --gi

[PATCH 09/62] usb: dwc3: gadget: rely on sg_is_last() and list_is_last()

2016-05-30 Thread Felipe Balbi
sg_is_last() and list_is_last() will encode the required information for the driver to make decisions WRT CHN and LST bits. While at that, also replace '1' with 'true' for consistency. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 10 +- 1 file changed

[PATCH 13/62] usb: dwc3: gadget: initialize NUMP based on RxFIFO Size

2016-05-30 Thread Felipe Balbi
Instead of using burst size to configure NUMP, we should be using RxFIFO Size instead. DWC3 is smart enough to know that it shouldn't burst in case burst size is 0. Reported-by: John Youn Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h | 12 +++ drivers/usb/dwc3/gadget.c

[PATCH 23/62] usb: dwc3: implement runtime PM

2016-05-30 Thread Felipe Balbi
implemented once we decide to support hibernation, which is to allow runtime_suspend with cable connected when bus is in U3. That's subject to a separate patch, however. Tested-by: Baolin Wang Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.c

[PATCH 19/62] usb: dwc3: gadget: hold gadget IRQ in dwc->irq_gadget

2016-05-30 Thread Felipe Balbi
by holding gadget's IRQ number in dwc->irq_gadget, it'll be simpler to free_irq() and disable the IRQ in case an IRQ fires while we are runtime suspended. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h | 2 ++ drivers/usb/dwc3/gadget.c | 5 ++--- 2 files changed, 4 ins

[PATCH 03/62] usb: gadget: net2280: add USB2380 support

2016-05-30 Thread Felipe Balbi
: Felipe Balbi --- drivers/usb/gadget/udc/Kconfig | 4 +++- drivers/usb/gadget/udc/net2280.c | 51 +++- drivers/usb/gadget/udc/net2280.h | 1 + 3 files changed, 34 insertions(+), 22 deletions(-) diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget

[PATCH 04/62] usb: dwc3: gadget: re-factor ->udc_start and ->udc_stop

2016-05-30 Thread Felipe Balbi
we will be re-using it for suspend/resume, so instead of duplicating code, let's just re-factor the functions so they can be re-used. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 90 ++- 1 file changed, 49 insertions(+), 41 dele

[PATCH 07/62] usb: dwc3: gadget: prepare TRBs on update transfers too

2016-05-30 Thread Felipe Balbi
ring, we check if we have space to wrap around the ring properly. Note that this only happens when our enqueue and dequeue pointers are equal (which is the case for bulk endpoints after an XferComplete event). Signed-off-by: Felipe Balbi --- drive

[PATCH 20/62] usb: dwc3: gadget: only resume USB2 PHY in <=HIGHSPEED

2016-05-30 Thread Felipe Balbi
As a micro-power optimization, let's only resume the USB2 PHY if we're working on <=HIGHSPEED. If we're gonna work on SUPERSPEED or SUPERSPEED+, there's no point in resuming the USB2 PHY. Fixes: 2b0f11df84bb ("usb: dwc3: gadget: clear SUSPHY bit before ep cmds&q

[PATCH 12/62] usb: dwc3: gadget: split __dwc3_gadget_kick_transfer()

2016-05-30 Thread Felipe Balbi
To aid code readability, we're gonna split __dwc3_gadget_kick_transfer() into its constituent parts: scatter gather and linear buffers. That way, it's easier to follow the code and focus debug effort when one or the other fails. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadg

[PATCH 15/62] usb: dwc3: gadget: add a pointer to endpoint registers

2016-05-30 Thread Felipe Balbi
e our debugfs interface and io accessors need to be changed accordingly. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h| 13 +++- drivers/usb/dwc3/debugfs.c | 190 ++--- drivers/usb/dwc3/ep0.c | 4 +- drivers/usb/dwc3/gadget.c

[PATCH 02/62] usb: gadget: storage: increase maximum storage num buffers

2016-05-30 Thread Felipe Balbi
rease maximum number of storage buffers to a ridiculous amount (256) so that anybody wanting to test maximum achievable throughput can do so. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/Kcon

[PATCH 05/62] usb: dwc3: gadget: fix gadget suspend/resume

2016-05-30 Thread Felipe Balbi
rnation is only useful for runtime PM, not system sleep. While at that, also remove dwc3.dcfg which has been rendered unnecessary. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h | 1 - drivers/usb/dwc3/gadget.c | 44 2 files changed, 12

[PATCH 21/62] usb: dwc3: fix for the isoc transfer EP_BUSY flag

2016-05-30 Thread Felipe Balbi
nal commit and making sure that we check for isochronous endpoints. Fixes: f3af36511e60 ("usb: dwc3: gadget: always enable IOC on bulk/interrupt transfers") Cc: Signed-off-by: Konrad Leszczynski Signed-off-by: Rafal Redzimski Signed-off-by: Felipe Balbi --- drivers/u

[PATCH 43/62] usb: dwc3: gadget: Account for link TRB in TRBs left

2016-05-30 Thread Felipe Balbi
From: John Youn The TRBs left calculation didn't account for the link TRB taking up one spot. If the trb_dequeue < trb_enqueue, then the result includes the link TRB slot so it must be adjusted. Signed-off-by: John Youn Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c |

[PATCH 31/62] usb: dwc3: trace: print ep cmd status with a single trace

2016-05-30 Thread Felipe Balbi
Instead of printing command's status with a separate trace printout, let's print it within a single call. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/debug.h | 16 drivers/usb/dwc3/gadget.c | 8 +--- drivers/usb/dwc3/trace.h | 15 +-- 3 files c

[PATCH 44/62] usb: dwc3: gadget: Handle TRB index 0 when full or empty

2016-05-30 Thread Felipe Balbi
From: John Youn If the trb->enqueue == trb->dequeue, then it could be full or empty. This could also happen at TRB index 0, so modify the check to handle that condition. At index 0, the previous TRB is the one just before the link TRB. Signed-off-by: John Youn Signed-off-by: Felipe

[PATCH 37/62] usb: dwc3: gadget: Fix usage of bitwise operator

2016-05-30 Thread Felipe Balbi
From: John Youn Cleans up the sparse warning: warning: dubious: x | !y Since we do want a bitwise OR here, don't use a logical (true/false) value. Probably is not a real issue but it cleans up the warning. Signed-off-by: John Youn Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gad

[PATCH 25/62] usb: dwc3: gadget: add a per-endpoint request queue lock

2016-05-30 Thread Felipe Balbi
This will allow us to process several endpoints at a time by making sure that we lock only shared resources. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h | 2 ++ drivers/usb/dwc3/gadget.c | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/usb/dwc3/core.h b/drivers/usb

[PATCH 24/62] usb: dwc3: pci: add Power Management dummy hooks

2016-05-30 Thread Felipe Balbi
Allow for dwc3-pci to reach D3 and enable pm_runtime by providing dummy PM hooks. Without them, PCI subsystem won't put device to D3. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/dwc3-pci.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/usb

[PATCH 33/62] usb: dwc3: gadget: remove udelay() from generic cmd

2016-05-30 Thread Felipe Balbi
We want commands to finish ASAP, so let's remove that udelay() call. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index f384ad379234..5cec5811169a 100644 --- a/driver

[PATCH 38/62] usb: dwc3: Endianness issue on dwc3_log_ctrl

2016-05-30 Thread Felipe Balbi
From: John Youn Sparse complains even though it looks ok. Probably it cannot detect that the wValue, wIndex, and wLength are declared __le16 due to the macro magic. Redeclare them as CPU endianness and make the conversion on assignment. Signed-off-by: John Youn Signed-off-by: Felipe Balbi

[PATCH 41/62] usb: dwc3: gadget: Don't prepare TRBs if no space

2016-05-30 Thread Felipe Balbi
From: John Youn If trbs_left == 0, we don't have any space left in the TRB ring so don't prepare anything. Signed-off-by: John Youn Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/driver

[PATCH 47/62] usb: dwc3: Fix DWC3_USB31_REVISION_110A definition

2016-05-30 Thread Felipe Balbi
From: John Youn The DWC3_USB31_REVISION_110A macro uses an invalid constant name in its definition. This is currently not used. Signed-off-by: John Youn Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb

[PATCH 29/62] usb: dwc3: gadget: fix trace output when command fails

2016-05-30 Thread Felipe Balbi
We don't need the extra %s when command fails. Let's remove it Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 770664c9c83e..efb758e5c6c7 10

[PATCH 48/62] usb: dwc3: add DWC3_GUCTL1 reg for debug

2016-05-30 Thread Felipe Balbi
this bit can be reset to default 0 after the core reset. Dump GUCTL1 reg from debugfs is more convenient for us. Signed-off-by: William Wu Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h| 1 + drivers/usb/dwc3/debugfs.c | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers

[PATCH 27/62] usb: dwc3: gadget: no more tracking endpoint type with its name

2016-05-30 Thread Felipe Balbi
negligible added benefit. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 24 +--- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 65184d9480e8..770664c9c83e 100644 --- a/drivers/usb/dwc3/gadget.c

[PATCH 42/62] usb: dwc3: gadget: Account for max size in TRB space

2016-05-30 Thread Felipe Balbi
u need to mod the result by DWC3_TRB_NUM. For example the same calculation with DWC3_TRB_NUM = 8, results in: 255 % 6 = 7 TRBs left. Signed-off-by: John Youn Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drive

[PATCH 46/62] usb: dwc3: Use the correct speed macros for DSTS/DCFG

2016-05-30 Thread Felipe Balbi
From: John Youn Correct the use of the DWC3_DSTS_XXX_SPEED and DWC3_DCFG_XXX_SPEED macros. The wrong set of macros were being used in a few places. This is only a cosmetic change as the values for both sets are identical. Signed-off-by: John Youn Signed-off-by: Felipe Balbi --- drivers/usb

[PATCH 16/62] usb: dwc3: core: move fladj to dwc3 structure

2016-05-30 Thread Felipe Balbi
this patch is in preparation for some further re-factoring in dwc3 initialization. No functional changes. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.c | 16 +++- drivers/usb/dwc3/core.h | 2 ++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/usb

[PATCH 22/62] usb: dwc3: gadget: fix for possible endpoint disable race

2016-05-30 Thread Felipe Balbi
's avoid the problem by simply returning early if we have a NULL descriptor. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index

[PATCH 36/62] usb: dwc3: ep0: Use the correct type for SET_SEL data

2016-05-30 Thread Felipe Balbi
From: John Youn u2sel and u2pel should be __le16. Doesn't fix any issue. Found with sparse. Signed-off-by: John Youn Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/ep0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/

[PATCH 17/62] usb: dwc3: core: re-factor init and exit paths

2016-05-30 Thread Felipe Balbi
rting point. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.c | 118 1 file changed, 60 insertions(+), 58 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 1f4ac355f384..cbdefbb3d302 100644 --- a/drivers/usb

[PATCH 30/62] usb: dwc3: gadget: loop while (timeout)

2016-05-30 Thread Felipe Balbi
instead of having infinite loop and always checking timeout value as a break condition, we can just decrement timeout inside while's condition. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --

[PATCH 40/62] usb: dwc3: gadget: Initialize the TRB ring

2016-05-30 Thread Felipe Balbi
From: John Youn Clears out all the TRBs in the ring to clean up any stale data that might be in them from the previous time the endpoint was enabled. Also removed the existing clear of the LINK trb since the entire ring is cleard just before. Signed-off-by: John Youn Signed-off-by: Felipe

[PATCH 34/62] usb: dwc3: gadget: improve gcmd trace

2016-05-30 Thread Felipe Balbi
Just like we did for endpoint commands, let's have a single trace output for the command and its status. This will improve trace readability Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/debug.h | 14 ++ drivers/usb/dwc3/gadget.c | 14 ++ drivers/usb/dwc3/tr

[PATCH 35/62] usb: dwc3: ep0: Fix endianness of wIndex passed to dwc3_wIndex_to_dep

2016-05-30 Thread Felipe Balbi
From: John Youn The wIndex passed in here is CPU endianness, but the function expects little endian. Found with sparse. Signed-off-by: John Youn Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/ep0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/ep0.c

[PATCH 39/62] usb: dwc3: gadget: Simplify skipping of link TRBs

2016-05-30 Thread Felipe Balbi
From: John Youn Make the skipping of the link TRBS built-in to the increment operation. This simplifies the code wherever we increment the trb index and ensures that we never end up pointing to a link trb. Signed-off-by: John Youn Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c

[PATCH 28/62] usb: dwc3: trace: fully decode IRQ events

2016-05-30 Thread Felipe Balbi
This will make it more human-friendly to read trace output from dwc3. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/debug.h | 110 +-- drivers/usb/dwc3/ep0.c | 7 +-- drivers/usb/dwc3/trace.h | 3 +- 3 files changed, 92 insertions(+), 28

[PATCH 32/62] usb: dwc3: gadget: single return point on generic commands

2016-05-30 Thread Felipe Balbi
Just like we did for endpoint commands, let's use a single return point for generic commands as well. This aids readability. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/drivers/usb

[PATCH 26/62] usb: dwc3: trace: pretty-print TRB's ctrl field

2016-05-30 Thread Felipe Balbi
means that bit is set, while lowercase letter means bit is cleared. Signed-off-by: Janusz Dziedzic Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/trace.h | 40 ++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/trace.h b/drivers

[PATCH 45/62] usb: dwc3: gadget: Fix truncated cast issue

2016-05-30 Thread Felipe Balbi
ned-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index fd3a52a8cbaf..44dbb9bbdc8f 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -860,7 +86

[PATCH 62/62] usb: dwc3: gadget: decrement trbs_left for each sg entry

2016-05-30 Thread Felipe Balbi
If we don't, we will overwrite valid TRBs. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index c42786ff4752..3d0745dece0c 100644 --- a/drivers/usb/dwc3/gad

[PATCH 61/62] usb: dwc3: gadget: start Bulk endpoints more frequently

2016-05-30 Thread Felipe Balbi
Now we can try to issue Update Transfer every time gadget driver queues a new request. This will make sure we keep controller's queue busy for as long as possible. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --

[PATCH 58/62] usb: dwc3: gadget: halt and stop based on queued requests

2016-05-30 Thread Felipe Balbi
Instead of relying on empty list of queued requests, let's rely on the number of incomplete requests actually in traffic. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/driver

[PATCH 56/62] usb: dwc3: gadget: update transfer needs transfer resource

2016-05-30 Thread Felipe Balbi
According to SNPS databook, we need to pass transfer resource on update transfer command, let's do it. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c

[PATCH 57/62] usb: dwc3: gadget: keep track of allocated and queued reqs

2016-05-30 Thread Felipe Balbi
We will be using this information to change how we figure out when we need LST bit. For now, just update our counters. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h | 4 drivers/usb/dwc3/gadget.c | 7 +++ drivers/usb/dwc3/trace.h | 9 +++-- 3 files changed, 18

[PATCH 50/62] usb: dwc3: omap: Mark the interrupt handler as shared

2016-05-30 Thread Felipe Balbi
From: Roger Quadros On OMAPs, OTG events come on the same IRQ so we need to share this IRQ with the OTG device driver. Signed-off-by: Roger Quadros Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/dwc3-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb

[PATCH 55/62] usb: dwc3: remove handling of platform data

2016-05-30 Thread Felipe Balbi
From: Heikki Krogerus No more users for it. Tested-by: John Youn Signed-off-by: Heikki Krogerus Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.c | 35 -- drivers/usb/dwc3/platform_data.h | 53 2 files changed

[PATCH 54/62] usb: dwc3: pci: use build-in properties instead of platform data

2016-05-30 Thread Felipe Balbi
From: Heikki Krogerus This should allow the core driver to drop handling of platform data and expect the platform specific details to always come from properties. Tested-by: John Youn Signed-off-by: Heikki Krogerus Cc: Huang Rui CC: John Youn Signed-off-by: Felipe Balbi --- drivers/usb

[PATCH 59/62] usb: dwc3: gadget: use allocated/queued reqs for LST bit

2016-05-30 Thread Felipe Balbi
Let's only set LST bit when we run out of space in our TRB ring. For all other cases, we keep LST bit unset which will prevent constant allocation and deallocation of endpoint transfer resources. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 20 ++-- 1 file ch

[PATCH 60/62] usb: dwc3: gadget: disable XFER_NOT_READY

2016-05-30 Thread Felipe Balbi
We don't need this IRQ anymore. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 7a0c787cecdd..613dde9fb538 100644 --- a/drivers/usb/dwc3/gadget.c

[PATCH 51/62] usb: dwc3: omap: Don't set POWERPRESENT

2016-05-30 Thread Felipe Balbi
n the USB2 VBUS status fields in the same register." Signed-off-by: Roger Quadros Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/dwc3-omap.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c ind

[PATCH 53/62] usb: dwc3: remove trailing newline from dwc3_trace

2016-05-30 Thread Felipe Balbi
when passing strings to trace, we don't need the trailing newline character. Trace already appends a newline character automatically. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/ep0.c| 4 ++-- drivers/usb/dwc3/gadget.c | 32 2 files change

[PATCH 52/62] usb: dwc3: omap: Pass VBUS and ID events transparently

2016-05-30 Thread Felipe Balbi
igned-off-by: Roger Quadros Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/dwc3-omap.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index 046bb379120e..29e80cc9b634 100644 --- a/drivers/usb/dwc3

[PATCH 49/62] usb: dwc3: omap: use request_threaded_irq()

2016-05-30 Thread Felipe Balbi
he OTG IRQ handler's IRQ flags. NOTE: OTG IRQ handler is yet to be added. This is a preparatory step. Signed-off-by: Roger Quadros Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/dwc3-omap.c | 32 ++-- 1 file changed, 26 insertions(+), 6 deletions(-) diff --gi

Re: [PATCH 23/62] usb: dwc3: implement runtime PM

2016-05-30 Thread Felipe Balbi
Hi, Roger Quadros writes: > On 30/05/16 14:35, Felipe Balbi wrote: >> this patch implements the most basic pm_runtime >> support for dwc3. Whenever USB cable is dettached, >> then we will allow core to runtime_suspend. >> >> Runtime suspending will involve

[PATCH 2/2] usb: dwc3: gadget: stop transfers before ->reset()

2016-05-30 Thread Felipe Balbi
This is mostly cosmetic. usb_ep_disable(), which will be called by ->reset(), should force transfers to be stopped. We're just making sure it runs before that. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH 1/2] usb: dwc3: gadget: set xfer resource per endpoint

2016-05-30 Thread Felipe Balbi
Instead of looping through all endpoints when enabling ep0, let's allow for each endpoint to set its own xfer resource. This solves an issue which happens when we issue END_TRANSFER due to a reset interrupt. Endpoints will be left without a xfer resource to use. Signed-off-by: Felipe

Re: [PATCH v2] usb: dwc3: Set the ClearPendIN bit on Clear Stall EP command

2016-05-31 Thread Felipe Balbi
Hi John, John Youn writes: > As of core revision 2.60a the recommended programming model is to set > the ClearPendIN bit when issuing a Clear Stall EP command for IN > endpoints. This is to prevent an issue where some (non-compliant) hosts > may not send ACK TPs for pending IN transfers due to a

Re: [PATCH 0/4] usb: gadget: fix most of W=1 warinngs

2016-05-31 Thread Felipe Balbi
Hi, Michal Nazarewicz writes: > Fixes all of the unused-but-set-variable warnings enabled when > building with W=1. As described in the first patch, some warnings are > left off. See said patch for more description. > > Michal Nazarewicz (4): > usb: gadget: fix unused-but-set-variale warning

Re: [PATCH 00/13] usb: dwc2: Fix up gadget isochronous support

2016-05-31 Thread Felipe Balbi
Hi, John Youn writes: > The following patch series fixes up isochronous support for the dwc2 > gadget. The existing isochronous support lacked a few features. Most > notably it did not properly sync up with the first packet and it > didn't handle the Incomplete ISO IN/OUT interrupts. > > These p

[PATCH 1/2] usb: gadget: move gadget API functions to udc-core

2016-05-31 Thread Felipe Balbi
instead of defining all functions as static inlines, let's move them to udc-core and export them with EXPORT_SYMBOL_GPL, that way we can make sure that only GPL drivers will use them. As a side effect, it'll be nicer to add tracepoints to the gadget API. Signed-off-by: Felipe Balbi --

[PATCH 2/2] usb: gadget: add tracepoints to the gadget API

2016-05-31 Thread Felipe Balbi
same. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/Makefile | 5 + drivers/usb/gadget/udc/{udc-core.c => core.c} | 260 +- drivers/usb/gadget/udc/trace.c| 18 ++ drivers/usb/gadget/udc/trace.h|

[PATCH 1/2] usb: gadget: move gadget API functions to udc-core

2016-05-31 Thread Felipe Balbi
instead of defining all functions as static inlines, let's move them to udc-core and export them with EXPORT_SYMBOL_GPL, that way we can make sure that only GPL drivers will use them. As a side effect, it'll be nicer to add tracepoints to the gadget API. Signed-off-by: Felipe Balbi --

USB g_mass_storage weirdness

2016-05-31 Thread Felipe Balbi
Hi guys, I'm getting a weird behavior with g_mass_storage which I'm yet to verify if it's a g_mass_storage bug on XHCI bug. So far it points to g_mass_storage. Below you can see a commented set of trace data (see the 2-patch series I just sent): [...] > file-storage-1252 [003] ...1 254.79366

Re: USB g_mass_storage weirdness

2016-05-31 Thread Felipe Balbi
Hi, Felipe Balbi writes: >> irq/17-dwc3-1253 [000] d..1 315.944886: usb_gadget_vbus_draw: speed 5/5 >> state 7 0mA [sg:out_aligned:self-powered:activated:connected] --> -95 >> file-storage-1252 [003] ...1 315.945556: usb_ep_fifo_flush: ep1in: mps >> 1024/1024

<    1   2   3   4   5   6   7   8   9   10   >