Add MediaTek USB3 DRD Driver

2016-05-30 Thread Chunfeng Yun
>From f2b6744b1ed13636db8690dd3e8d65ad7f3fb7ce Mon Sep 17 00:00:00 2001 From: Chunfeng Yun Date: Tue, 31 May 2016 10:52:46 +0800 Subject: [PATCH 0/5] Add MediaTek USB3 DRD Driver These patches introduce the MediaTek USB3 dual-role controller driver. The driver can be

[PATCH v2,5/5] arm64: dts: mediatek: add USB3 DRD driver

2016-05-30 Thread Chunfeng Yun
USB3 DRD driver is added for MT8173-EVB, and xHCI driver becomes its subnode Signed-off-by: Chunfeng Yun --- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 46 +-- arch/arm64/boot/dts/mediatek/mt8173.dtsi| 28 2 files

[PATCH v2,1/5] dt-bindings: mt8173-xhci: support host side of dual-role mode

2016-05-30 Thread Chunfeng Yun
Some resources, such as IPPC register etc, shared with device driver are moved into common glue layer when xHCI driver is the host side of dual-role mode and they should be changed as optional properties if they are required ones before. For clarity, add a new part of binding to support host side

[PATCH v2,2/5] usb: xhci-mtk: make IPPC register optional

2016-05-30 Thread Chunfeng Yun
Make IPPC register optional to support host side of dual-role mode, due to it is moved into common glue layer for simplification. Signed-off-by: Chunfeng Yun --- drivers/usb/host/xhci-mtk.c | 32 +++- 1 file changed, 27 insertions(+), 5

[PATCH v2,4/5] usb: Add MediaTek USB3 DRD Driver

2016-05-30 Thread Chunfeng Yun
This patch adds support for the MediaTek USB3 controller integrated into MT8173. It can be configured as Dual-Role Device (DRD), Peripheral Only and Host Only (xHCI) modes. Signed-off-by: Chunfeng Yun --- drivers/usb/Kconfig|2 +

Re: [PATCH] reset: Put back *_optional variants

2016-05-30 Thread John Youn
On 5/30/2016 4:32 AM, Hans de Goede wrote: > Hi, > > On 30-05-16 12:18, Philipp Zabel wrote: >> Hi, >> >> Am Freitag, den 27.05.2016, 09:06 +0200 schrieb Hans de Goede: >> [...] > So IMHO the following change would be a better way to fix this: > > --- a/include/linux/reset.h > +++

[PATCH v2,3/5] dt-bindings: mtu3: add devicetree bindings

2016-05-30 Thread Chunfeng Yun
add a DT binding doc for MediaTek USB3 DRD driver Signed-off-by: Chunfeng Yun --- Documentation/devicetree/bindings/usb/mtu3.txt | 85 1 file changed, 85 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/mtu3.txt diff

ttyACM device issue.

2016-05-30 Thread Dave Mielke
Is this the right mailing list for ttyACM device issues, or should I be contactring the serial device people? Just in case this is the right place, here's the issue. I'm using Linux kernel 3.11.10-100.fc18.x86_64. I'm using termios, among other things, to turn ICANON off and to set both VTIME

[PATCH V9 1/1] usb:serial: Add Fintek F81532/534 driver

2016-05-30 Thread Ji-Ze Hong (Peter Hong)
This driver is for Fintek F81532/F81534 USB to Serial Ports IC. F81532 spec: https://drive.google.com/file/d/0B8vRwwYO7aMFOTRRMmhWQVNvajQ/view? usp=sharing F81534 spec: https://drive.google.com/file/d/0B8vRwwYO7aMFV29pQWJqbVBNc00/view? usp=sharing Features: 1. F81532 is 1-to-2 & F81534 is

Re: [PATCH] usb:serial: Add Fintek F81532/534 driver

2016-05-30 Thread Peter Hung
Hi, Ji-Ze Hong (Peter Hong) 於 2016/5/31 上午 09:33 寫道: This driver is for Fintek F81532/F81534 USB to Serial Ports IC. Sorry, I forgot to change the mail title for "PATCH V9". I'll resend a patch with title "PATCH V9". Thanks -- With Best Regards, Peter Hung -- To unsubscribe from this list:

[PATCH] usb:serial: Add Fintek F81532/534 driver

2016-05-30 Thread Ji-Ze Hong (Peter Hong)
This driver is for Fintek F81532/F81534 USB to Serial Ports IC. F81532 spec: https://drive.google.com/file/d/0B8vRwwYO7aMFOTRRMmhWQVNvajQ/view? usp=sharing F81534 spec: https://drive.google.com/file/d/0B8vRwwYO7aMFV29pQWJqbVBNc00/view? usp=sharing Features: 1. F81532 is 1-to-2 & F81534 is

Re: [RFC v2 00/13] usb/mmc/power: Fix USB/LAN when TFTP booting

2016-05-30 Thread Peter Chen
On Sat, May 28, 2016 at 11:36:13AM +0800, Peter Chen wrote: > On Tue, May 10, 2016 at 01:02:08PM +0200, Ulf Hansson wrote: > > + Arnd > > > > [...] > > > > >> >> Solution > > >> >> > > >> >> This is very similar to the MMC pwrseq behavior so the idea is to: > > >> >> 1. Move MMC pwrseq

[PATCH 4.4 18/86] asix: Fix offset calculation in asix_rx_fixup() causing slow transmissions

2016-05-30 Thread Greg Kroah-Hartman
4.4-stable review patch. If anyone has any objections, please let me know. -- From: John Stultz commit cd9e2e5d3ff148be9ea210f622ce3e8e8292fcd6 upstream. In testing with HiKey, we found that since commit 3f30b158eba5 ("asix: On RX avoid creating bad

[PATCH 4.5 15/87] asix: Fix offset calculation in asix_rx_fixup() causing slow transmissions

2016-05-30 Thread Greg Kroah-Hartman
4.5-stable review patch. If anyone has any objections, please let me know. -- From: John Stultz commit cd9e2e5d3ff148be9ea210f622ce3e8e8292fcd6 upstream. In testing with HiKey, we found that since commit 3f30b158eba5 ("asix: On RX avoid creating bad

[PATCH 4.6 014/100] asix: Fix offset calculation in asix_rx_fixup() causing slow transmissions

2016-05-30 Thread Greg Kroah-Hartman
4.6-stable review patch. If anyone has any objections, please let me know. -- From: John Stultz commit cd9e2e5d3ff148be9ea210f622ce3e8e8292fcd6 upstream. In testing with HiKey, we found that since commit 3f30b158eba5 ("asix: On RX avoid creating bad

Re: USB broken on Banana Pi in Linux 4.6

2016-05-30 Thread Greg KH
On Mon, May 30, 2016 at 09:02:54PM +0200, Marc Haber wrote: > Hi, > > on my Bananapis, in kernel 4.6 USB does not work. Kernel configuration > is USB-wise identical to 4.5 (grepped for differences in (hci|usb)), > and in 4.6 there is not even /dev/bus/usb. Hint, include linux-usb@vger in

Re: PROBLEM: Kernel Bug on USB unplugging (Elo TouchSystems CarrollTouch 4500U)

2016-05-30 Thread Alan Stern
On Mon, 30 May 2016, Pierre Sauter wrote: > On unplugging this USB Touchscreen, everytime I get either: > > [ 161.596055] BUG: unable to handle kernel NULL pointer dereference at > 0015 > [ 161.596093] IP: [] get_next_timer_interrupt+0x80/0x270 > or > [ 155.892061] BUG: unable to handle

[PATCH] USB: mos7720: delete parport

2016-05-30 Thread Sudip Mukherjee
parport subsystem has introduced parport_del_port() to delete a port when it is going away. Without parport_del_port() the registered port will not be unregistered. To reproduce and verify the error: Command to be used is : ls /sys/bus/parport/devices 1) without the device attached there is no

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

2016-05-30 Thread Steinar H. Gunderson
On Fri, May 27, 2016 at 04:26:42PM +0300, Felipe Balbi wrote: >> Sent. As a fix, there's a chance it could go into 4.7, right? > yup, shouldn't be a problem. But only after v4.7-rc1 is tagged. Seemingly v4.7-rc1 is out today (I was surprised at how quick that was). /* Steinar */ -- Homepage:

PROBLEM: Kernel Bug on USB unplugging (Elo TouchSystems CarrollTouch 4500U)

2016-05-30 Thread Pierre Sauter
On unplugging this USB Touchscreen, everytime I get either: [ 161.596055] BUG: unable to handle kernel NULL pointer dereference at 0015 [ 161.596093] IP: [] get_next_timer_interrupt+0x80/0x270 or [ 155.892061] BUG: unable to handle kernel paging request at 30303046 [ 155.892101] IP: []

Re: Unable to safely detach external HDD on USB 3.0

2016-05-30 Thread Alan Stern
On Sun, 29 May 2016, Marco Chiappero wrote: > Hello, > > I'm experiencing a problem I'm not able to troubleshoot. > > I own a WD Elements Portable USB 3.0 HDD (WDBU6Y0020BBK) containing a > drive model WD20NMVW-11AV3S3. When connected to a USB 3.0 port the drive > works perfectly fine until I

[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

[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 Balbi

Re: [PATCH v8 00/14] USB OTG/dual-role framework

2016-05-30 Thread Roger Quadros
On 30/05/16 12:29, Peter Chen wrote: > On Fri, May 13, 2016 at 01:03:14PM +0300, Roger Quadros wrote: >> Hi, >> >> This series centralizes OTG/Dual-role functionality in the kernel. >> As of now I've got Dual-role functionality working pretty reliably on >> dra7-evm and am437x-gp-evm. >> NOTE: my

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-05-30 Thread Oliver Neukum
On Mon, 2016-05-30 at 16:19 +0300, Heikki Krogerus wrote: > Hi guys, > > I'm attaching a diff instead of full v3. I'm not yet adding attributes > for the reset and cable_reset. I still don't understand what is the > case where the userspace would need to be able to tricker reset? Why > isn't it

Re: [PATCH] usb: echi-hcd: Add ehci_setup check before echi_shutdown

2016-05-30 Thread Pramod Gurav
On 19 May 2016 at 15:42, Srinivas Kandagatla wrote: > Fixes 4bb3cad7125b ("usb: host: ehci-msm: Register usb shutdown function") > Signed-off-by: Srinivas Kandagatla Was seeing this crash while doing a reboot on db410c which is

Re: [RFC PATCHv2] usb: USB Type-C Connector Class

2016-05-30 Thread Heikki Krogerus
Hi guys, I'm attaching a diff instead of full v3. I'm not yet adding attributes for the reset and cable_reset. I still don't understand what is the case where the userspace would need to be able to tricker reset? Why isn't it enough for the userspace to be able to enter/exit modes? Oliver! Can

Re: [PATCH v9 7/7] MAINTAINERS: add maintainer entry for Intel USB dual role mux drivers

2016-05-30 Thread Lu Baolu
Hi Heikki, On 05/30/2016 04:16 PM, Heikki Krogerus wrote: > Hi Baolu, > > On Mon, May 30, 2016 at 01:51:44PM +0800, Lu Baolu wrote: >> Add a maintainer entry for Intel USB dual role mux drivers and >> add myself as a maintainer. >> >> Signed-off-by: Lu Baolu >> --- >>

Re: [RFC PATCH] usb: typec: Various API updates and fixes

2016-05-30 Thread Heikki Krogerus
Hi guys, On Fri, May 27, 2016 at 07:06:41AM -0700, Guenter Roeck wrote: > On 05/27/2016 12:55 AM, Heikki Krogerus wrote: > > I'll merge this into any case to v3, and I'll send on Monday. > > > Sounds good. > > Couple of additional comments. > > I don't really know what to do with the 'desc'

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 completely tearing >>

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

2016-05-30 Thread Roger Quadros
Hi Felipe, 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 completely tearing > down event buffers and require a full

Re: [PATCH] reset: Put back *_optional variants

2016-05-30 Thread Philipp Zabel
Am Montag, den 30.05.2016, 13:32 +0200 schrieb Hans de Goede: > Hi, > > On 30-05-16 12:18, Philipp Zabel wrote: > > Hi, > > > > Am Freitag, den 27.05.2016, 09:06 +0200 schrieb Hans de Goede: > > [...] > So IMHO the following change would be a better way to fix this: > > ---

[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

[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 ---

[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

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

2016-05-30 Thread Felipe Balbi
From: Roger Quadros Don't make any decisions regarding VBUS session based on ID status. That is best left to the OTG core. Pass ID and VBUS events independent of each other so that OTG core knows exactly what to do. This makes dual-role with extcon work with OTG irq on OMAP

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

2016-05-30 Thread Felipe Balbi
From: Roger Quadros We intend to share this interrupt with the OTG driver an to ensure that irqflags match for the shared interrupt handlers we use request_threaded_irq() If we don't use request_treaded_irq() then forced threaded irq will set IRQF_ONESHOT and this won't match

[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

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

2016-05-30 Thread Felipe Balbi
From: Roger Quadros TRM [1] recommends that POWERPRESENT bit must not be set and left at it's default value of 0. [1] OMAP542x TRM - http://www.ti.com/lit/pdf/swpu249 Section 23.11.4.5.1 Mailbox VBUS/ID Management "Because PIPE powerpresent has a different meaning in host and in

[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,

[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

[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

[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

[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

[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

[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 +++--

[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

[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 +-

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

2016-05-30 Thread Felipe Balbi
From: William Wu GUCTL1 reg has some useful functions which can be written by user. For rockchip platform, we set GUCTL1.DEV_FORCE_20_CLK_FOR_30_CLK (bit26, applicable for the core is programmed to operate in 2.0 device only) to 1 in bootrom, and after start the

[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

[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

[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(+),

[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

[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 ++

[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

[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:

[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

[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(-)

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

2016-05-30 Thread Felipe Balbi
From: John Youn >From sparse: warning: cast truncates bits from constant value (100 becomes 0) The DWC3_TRB_NUM constant is too big for u8. Do the calculation a slightly different way that should still be optimized out for the case where DWC3_TRB_NUM == 256.

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

2016-05-30 Thread Felipe Balbi
From: Janusz Dziedzic Improve trb tracing by showing trb flags, interrupts trb type. trb flags: - h - hardware owner of descriptor - l - last TRB - c - chain buffers - s - continue on short packet interrupt flags: - s - interrupt on short packet - c -

[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

[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

[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

[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:

[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

[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(+)

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

2016-05-30 Thread Felipe Balbi
I really thought this would be useful, but as it turns out, it creates more problems than fixes. The amount of times we had to fix this because some other commit shuffled things around and ended up regressing this tiny little string manupulation... Might as well remove it, since it has a

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

2016-05-30 Thread Felipe Balbi
From: John Youn The current calculation takes dep->trb_dequeue - dep->trb_enqueue to find the TRB space left. If you enqueue 1, that results in: (u8) 0 - (u8) 1 = 0xff = 255 TRBs left. This is correct if DWC3_TRB_NUM == 256. If DWC3_TRB_NUM is less than 256 (but still a

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

2016-05-30 Thread Felipe Balbi
The idea of this patch is for dwc3_core_init() to abstract all the details about how to initialize dwc3 and dwc3_core_exit() to do the same for teardown. With this, we can simplify suspend/resume operations by a large margin and always know that we're going to start dwc3 from a known starting

[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

[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

[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

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

2016-05-30 Thread Felipe Balbi
From: Tim Harvey The PLX USB2380 is a PCIe version of the NET2280 and behaves more like the USB338x but without the USB3.0 superspeed support. This was tested with g_ether, g_serial, g_mass_storage on a Gateworks Ventana GW2383. Cc: Justin DeFields

[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

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

2016-05-30 Thread Felipe Balbi
If we're updating transfers, we can also prepare as many TRBs as we can fit in the ring. Let's start doing that. This patch 'solves' a limitation of how many TRBs we can prepare when we're getting close the end of the ring. Instead driver to prepare only up to end of the ring, we check if we have

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

2016-05-30 Thread Felipe Balbi
With a default size of 16kiB and with maximum of 32 buffers, we can transfer up to 512kiB, however Linux can transfer up to 1MiB in a single mass storage block transfer to USB3 storage devices. Because of this, 1MiB block transfers end up being slower than 512kiB block transfers. Let's increase

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

2016-05-30 Thread Felipe Balbi
Instead of trying hard to stay connected to the host, it's best (and far easier) to disconnect from the host already. Anything relying on KEEP_CONNECT will just have that ignored, but we don't have proper hibernation implementation yet, so there are no regressions. In any case, hibernation is

[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

[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

[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 ---

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

2016-05-30 Thread Felipe Balbi
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 completely tearing down event buffers and require a full soft-reset of the IP. Note that a further optimization could be

[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") Signed-off-by: Felipe Balbi

[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 ---

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

2016-05-30 Thread Felipe Balbi
From: Konrad Leszczynski commit f3af36511e60 ("usb: dwc3: gadget: always enable IOC on bulk/interrupt transfers") ended up regressing Isochronous endpoints by clearing DWC3_EP_BUSY flag too early, which resulted in choppy audio playback over USB. Fix that by

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

2016-05-30 Thread Felipe Balbi
Instead of returning -EINVAL when someone calls __dwc3_gadget_wakeup() in speeds > highspeed, let's return 0. There are no problems for the driver for calling it in superspeed as we cleanly just return. This avoids an annoying WARN_ONCE() always triggering during superspeed enumeration with LPM

[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

[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

[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

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

2016-05-30 Thread Felipe Balbi
By adding a pointer to endpoint registers' base address, we can avoid using our controller-wide struct dwc3 pointer for everything. At some point this will allow us to have per-endpoint locks which will, in turn, let us queue requests to separate endpoints in parallel. Because of this change our

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

2016-05-30 Thread Felipe Balbi
Hi folks, I've lost track of which patches had already been sent on linux-usb (sorry), so I'll just go ahead and send everything that I have on testing/next today rebased on v4.7-rc1. Please go through dwc3's changes (for those of you using dwc3) as there's a ton of important stuff happening

[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

Re: [PATCH] reset: Put back *_optional variants

2016-05-30 Thread Hans de Goede
Hi, On 30-05-16 12:18, Philipp Zabel wrote: Hi, Am Freitag, den 27.05.2016, 09:06 +0200 schrieb Hans de Goede: [...] So IMHO the following change would be a better way to fix this: --- a/include/linux/reset.h +++ b/include/linux/reset.h @@ -65,14 +65,14 @@ static inline struct reset_control

Re: [PATCH] reset: Put back *_optional variants

2016-05-30 Thread Philipp Zabel
Hi, Am Freitag, den 27.05.2016, 09:06 +0200 schrieb Hans de Goede: [...] > >> So IMHO the following change would be a better way to fix this: > >> > >> --- a/include/linux/reset.h > >> +++ b/include/linux/reset.h > >> @@ -65,14 +65,14 @@ static inline struct reset_control > >>

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: >>

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 is v0.99r >>> dated 2014-01-29). A

Re: [PATCH v8 00/14] USB OTG/dual-role framework

2016-05-30 Thread Peter Chen
On Fri, May 13, 2016 at 01:03:14PM +0300, Roger Quadros wrote: > Hi, > > This series centralizes OTG/Dual-role functionality in the kernel. > As of now I've got Dual-role functionality working pretty reliably on > dra7-evm and am437x-gp-evm. > NOTE: my am437x-gp-evm broke so I couldn't test v8 on

Re: Support for Pravega USB3 controller

2016-05-30 Thread Mathias Nyman
On 30.05.2016 11:31, Mason wrote: 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 is v0.99r dated 2014-01-29). A cursory search returns:

Re: Support for Pravega USB3 controller

2016-05-30 Thread Mason
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 is v0.99r >> dated 2014-01-29). A cursory search returns: >> >>

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

2016-05-30 Thread Heikki Krogerus
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: > >> This should allow xhci to remove handling of platform data. > >> > >>

Re: [PATCH v9 7/7] MAINTAINERS: add maintainer entry for Intel USB dual role mux drivers

2016-05-30 Thread Heikki Krogerus
Hi Baolu, On Mon, May 30, 2016 at 01:51:44PM +0800, Lu Baolu wrote: > Add a maintainer entry for Intel USB dual role mux drivers and > add myself as a maintainer. > > Signed-off-by: Lu Baolu > --- > MAINTAINERS | 10 ++ > 1 file changed, 10 insertions(+) > >

  1   2   >