Re: Identifying Synopsys USB3 Controller on Baytrail Device

2016-10-31 Thread Felipe Balbi
Hi, Joseph Kogut writes: > Well, after comparing the kernel log from both systems, it seems that > the device controller simply isn't being enumerated by the kernel for > some reason. > > Here's the relevant section from the Android kernel: > > <6>[0.612857] PCI host bridge to bus :00 >

Re: [PATCH v10 1/1] USB: serial: cp210x: Adding GPIO support for CP2105

2016-10-31 Thread Martyn Welch
On Tue, Oct 25, 2016 at 11:34:40AM +0200, Linus Walleij wrote: > Good work on this patch, nice that it got merged. > > I was just thinking that as an add-on, you may want to name > the gpio lines so they have meaningful names in userspace > when you use this with the chardev (I have reasons to bel

[balbi-usb:testing/next 82/82] drivers/usb/dwc3/dwc3-pci.c:118:4: error: implicit declaration of function 'acpi_str_to_uuid'

2016-10-31 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git testing/next head: 43f960528708df4edd74d176266f611b0e127772 commit: 43f960528708df4edd74d176266f611b0e127772 [82/82] usb: dwc3: pci: call _DSM for suspend/resume config: arm-multi_v7_defconfig (attached as .config) compiler:

[PATCH 05/82] usb: dwc3: gadget: properly check ep cmd

2016-10-31 Thread Felipe Balbi
The cmd argument we pass to dwc3_send_gadget_ep_cmd() could contain extra arguments embedded. When checking for StartTransfer command, we need to make sure to match only lower 4 bits which contain the actual command and ignore the rest. Reported-by: Janusz Dziedzic Signed-off-by: Felipe Balbi --

[PATCH 07/82] usb: dwc3: gadget: giveback request if we can't kick it

2016-10-31 Thread Felipe Balbi
There might be situations where a Start Transfer command might fail, if that ever happens, instead of simply removing the request from our list, we should give the request back to the gadget driver, otherwise we might eventually starve it from requests. Signed-off-by: Felipe Balbi --- drivers/us

[PATCH 00/82] usb: patch bomb

2016-10-31 Thread Felipe Balbi
Hi guys, Sorry for the patch bomb, but I wanted to make sure everyoby knows which patches are already queued up for the next window. They are still sitting in my testing/next branch, so I can still change any of them. Please make sure to go through each one of them. This very branch has been test

[PATCH 03/82] usb: gadget: composite: always set ep->mult to a sensible value

2016-10-31 Thread Felipe Balbi
ep->mult is supposed to be set to Isochronous and Interrupt Endapoint's multiplier value. This value is computed from different places depending on the link speed. If we're dealing with HighSpeed, then it's part of bits [12:11] of wMaxPacketSize. This case wasn't taken into consideration before.

[PATCH 01/82] usb: add helper to extract bits 12:11 of wMaxPacketSize

2016-10-31 Thread Felipe Balbi
According to USB Specification 2.0 table 9-4, wMaxPacketSize is a bitfield. Endpoint's maxpacket is laid out in bits 10:0. For high-speed, high-bandwidth isochronous endpoints, bits 12:11 contain a multiplier to tell us how many transactions we want to try per uframe. This means that if we want an

[PATCH 04/82] usb: dwc3: gadget: set PCM1 field of isochronous-first TRBs

2016-10-31 Thread Felipe Balbi
In case of High-Speed, High-Bandwidth endpoints, we need to tell DWC3 that we have more than one packet per interval. We do that by setting PCM1 field of Isochronous-First TRB. Cc: Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 13 +++-- 1 file changed, 11 insertions(+), 2

[PATCH 08/82] usb: dwc3: gadget: conditionally disable Link State change events

2016-10-31 Thread Felipe Balbi
Link State Change events are only needed for debugging and to apply certain workarounds on known errata. Let's save a few cycles by disabling these events completely on working revisions of the core. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 4 +++- 1 file changed, 3 insertions

[PATCH 02/82] usb: gadget: composite: correctly initialize ep->maxpacket

2016-10-31 Thread Felipe Balbi
usb_endpoint_maxp() returns wMaxPacketSize in its raw form. Without taking into consideration that it also contains other bits reserved for isochronous endpoints. This patch fixes one occasion where this is a problem by making sure that we initialize ep->maxpacket only with lower 10 bits of the va

[PATCH 06/82] usb: dwc3: gadget: make use of No Response Update Transfer

2016-10-31 Thread Felipe Balbi
No Response Update Transfer is a special type of Update Transfer command which can be used whenever we're not relying on XferNotReady to prepare transfers. With this, we don't need to wait for CMDACT to be cleared and issue further commands to the endpoint straight away. Let's start using this ver

[PATCH 09/82] usb: dwc3: debug: decode control endpoint phase too

2016-10-31 Thread Felipe Balbi
DWC3 can tell us which phase of a setup transfer we're getting into. Let's decode it from the event to make it easier to debug. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h | 1 + drivers/usb/dwc3/debug.h | 13 + 2 files changed, 14 insertions(+) diff --git a/drivers/us

[PATCH 10/82] usb: dwc3: gadget: remove redundant trace prints

2016-10-31 Thread Felipe Balbi
Removing some trace prints which were made redundant when we started decoding events and TRBs completely within their respective trace points. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/ep0.c| 17 + drivers/usb/dwc3/gadget.c | 43 +---

[PATCH 30/82] media: usb: uvc: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Cc: Laurent Pinchart Cc: Mauro Carvalho Chehab Cc: Acked-by: Laurent Pinchart Signed-off-by: Felipe Balbi --- drivers/media/usb/uvc/uvc_video.c | 2 +- 1 file cha

[PATCH 32/82] usb: core: devices: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Cc: Greg Kroah-Hartman Cc: Acked-by: Greg Kroah-Hartman Signed-off-by: Felipe Balbi --- drivers/usb/core/devices.c | 2 +- 1 file changed, 1 insertion(+), 1 deleti

[PATCH 22/82] usb: gadget: udc: gr: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/gr_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/gr_udc.c b/drivers/usb/gadget/udc/gr_udc.c ind

[PATCH 39/82] usb: gadget: udc: net2272: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/net2272.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/udc/net227

[PATCH 27/82] usb: musb: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Cc: Bin Liu Signed-off-by: Felipe Balbi --- drivers/usb/musb/musb_gadget.c | 6 +++--- drivers/usb/musb/musb_host.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb

[PATCH 18/82] usb: gadget: udc: bdc: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Cc: Ashwini Pahuja Cc: Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/bdc/bdc_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc_cmd.c b

[PATCH 29/82] usb: host: xhci: purge GET_MAX_PACKET()

2016-10-31 Thread Felipe Balbi
usb_endpoint_maxp() is now returning maxpacket correctly - iow only bits 10:0. We can finaly remove XHCI's private GET_MAX_PACKET macro. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-mem.c | 4 ++-- drivers/usb/host/xhci-mtk-sch.c | 4 ++-- drivers/usb/host/xhci-ring.c| 6 +++---

[PATCH 26/82] usb: misc: usbtest: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Signed-off-by: Felipe Balbi --- drivers/usb/misc/usbtest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 5c8210dc

[PATCH 12/82] usb: dwc3: trace: print out ep0state also from XferComplete

2016-10-31 Thread Felipe Balbi
With this extra piece of information, it will be easier to find mismatches between driver and HW. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/debug.h | 11 --- drivers/usb/dwc3/ep0.c| 4 drivers/usb/dwc3/gadget.c | 2 +- drivers/usb/dwc3/trace.h | 12 +++- 4 fil

[PATCH 11/82] usb: dwc3: debug: move dwc3_ep0_state_string() to debug.h

2016-10-31 Thread Felipe Balbi
We will be using dwc3_ep0_state_string() from within our tracepoints, so we need to move that helper to debug.h in order for it to be accessible. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/debug.h | 16 drivers/usb/dwc3/ep0.c | 16 2 files changed, 16 in

[PATCH 37/82] usb: gadget: udc: bdc: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Cc: Ashwini Pahuja Cc: Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/bdc/bdc_ep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drive

[PATCH 31/82] usb: chipidea: udc: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Cc: Peter Chen Cc: Signed-off-by: Felipe Balbi --- drivers/usb/chipidea/udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/chipid

[PATCH 21/82] usb: gadget: udc: fusb300: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/fusb300_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/fusb300_udc.c b/drivers/usb/gadget/udc/f

[PATCH 17/82] usb: gadget: udc: atmel: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Cc: Nicolas Ferre Cc: Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/atmel_usba_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc

[PATCH 28/82] usb: ch9: make usb_endpoint_maxp() return only packet size

2016-10-31 Thread Felipe Balbi
Now that we have a helper to gather periodic endpoints' multiplier bits from wMaxPacketSize and every driver is using it, we can safely make sure that usb_endpoint_maxp() returns only bits 10:0 of wMaxPacketSize which is where the actual packet size lies. Signed-off-by: Felipe Balbi --- include/

[PATCH 41/82] usb: gadget: udc: s3c2410: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/s3c2410_udc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/udc/s3

[PATCH 19/82] usb: gadget: udc: dummy: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Cc: Alan Stern Cc: Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/dummy_hcd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drive

[PATCH 16/82] usb: core: devices: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Cc: Greg Kroah-Hartman Cc: Acked-by: Greg Kroah-Hartman Signed-off-by: Felipe Balbi --- drivers/usb/core/devices.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/driv

[PATCH 33/82] usb: core: endpoint: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Cc: Greg Kroah-Hartman Acked-by: Greg Kroah-Hartman Signed-off-by: Felipe Balbi --- drivers/usb/core/endpoint.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions

[PATCH 15/82] usb: chipidea: udc: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Cc: Peter Chen Cc: Signed-off-by: Felipe Balbi --- drivers/usb/chipidea/udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc

[PATCH 38/82] usb: gadget: udc: dummy: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Cc: Alan Stern Cc: Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/dummy_hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/us

[PATCH 36/82] usb: gadget: udc: atmel: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Cc: Nicolas Ferre Cc: Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/atmel_usba_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dr

[PATCH 42/82] usb: misc: usbtest: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Signed-off-by: Felipe Balbi --- drivers/usb/misc/usbtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/misc/usbtest.c b/drivers/us

[PATCH 34/82] usb: host: ehci: remove unnecessary max_packet() macro

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove this macro from the driver. Cc: Alan Stern Cc: Signed-off-by: Felipe Balbi --- drivers/usb/host/ehci-q.c | 22 +- drivers/usb/host/ehci-sched.c | 1 - 2 files changed, 9 ins

[PATCH 13/82] media: usbtv: core: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Cc: Mauro Carvalho Chehab Cc: Signed-off-by: Felipe Balbi --- drivers/media/usb/usbtv/usbtv-core.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/usbtv/u

[PATCH 20/82] usb: gadget: udc: fsl: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Cc: Li Yang Cc: Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/fsl_udc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/driv

[PATCH 35/82] usb: gadget: composite: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/composite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/composite.c b/dr

[PATCH 23/82] usb: gadget: udc: mv_udc: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/mv_udc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/drivers/usb/gadget/udc/m

[PATCH 14/82] media: usb: uvc: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Cc: Laurent Pinchart Cc: Mauro Carvalho Chehab Cc: Signed-off-by: Felipe Balbi --- drivers/media/usb/uvc/uvc_video.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/me

[PATCH 25/82] usb: host: xhci: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Cc: Mathias Nyman Cc: Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-mem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/h

[PATCH 40/82] usb: gadget: udc: net2280: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/net2280.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/net2

[PATCH 24/82] usb: host: ehci: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Cc: Alan Stern Cc: Signed-off-by: Felipe Balbi --- drivers/usb/host/ehci-q.c | 10 ++ drivers/usb/host/ehci-sched.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a

[PATCH 66/82] usb: gadget: composite: use kasprintf() instead of open coding it

2016-10-31 Thread Felipe Balbi
From: Juergen Gross Let's not reimplement generic kernel helpers, instead call kasprintf(). [ felipe.ba...@linux.intel.com: better commit log ] Signed-off-by: Juergen Gross Signed-off-by: Felipe Balbi --- drivers/usb/gadget/composite.c | 14 ++ 1 file changed, 2 insertions(+), 12

[PATCH 48/82] usb: dwc3: don't compile dwc3_trace() unless CONFIG_FTRACE=y

2016-10-31 Thread Felipe Balbi
We don't need dwc3_trace() unless we're building a kernel with CONFIG_FTRACE. This patch reduces dwc3.ko text size a bit while also removing overhead of dwc3_trace() calls. textdata bss dec hex filename 50796 581 0 51377c8b1 drivers/usb/dwc3/dwc3.o 43961

[PATCH 49/82] usb: dwc3: Kconfig: allow all glues to build if COMPILE_TEST

2016-10-31 Thread Felipe Balbi
We shouldn't have any glue layer which doesn't compile everywhere. In order to make sure this is always the case, make sure COMPILE_TEST is properly added at dependency list of a config entry. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 d

[PATCH 68/82] usb: dwc2: cleanup with list_first_entry_or_null()

2016-10-31 Thread Felipe Balbi
From: Masahiro Yamada The combo of list_empty() check and return list_first_entry() can be replaced with list_first_entry_or_null(). Signed-off-by: Masahiro Yamada Acked-by: John Youn Signed-off-by: Felipe Balbi --- drivers/usb/dwc2/gadget.c | 6 ++ 1 file changed, 2 insertions(+), 4 del

[PATCH 58/82] usb: dwc3: remove unused struct member dwc3->mem

2016-10-31 Thread Felipe Balbi
From: Lu Baolu Member @mem in struct dwc3 is not used in any places. Clean up it. Signed-off-by: Lu Baolu Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.c | 1 - drivers/usb/dwc3/core.h | 3 --- 2 files changed, 4 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/co

[PATCH 70/82] usb: renesas_usbhs: cleanup with list_first_entry_or_null()

2016-10-31 Thread Felipe Balbi
From: Masahiro Yamada The combo of list_empty() check and return list_first_entry() can be replaced with list_first_entry_or_null(). Acked-by: Yoshihiro Shimoda Signed-off-by: Masahiro Yamada Signed-off-by: Felipe Balbi --- drivers/usb/renesas_usbhs/fifo.c | 5 + 1 file changed, 1 insert

[PATCH 55/82] usb: dwc3: gadget: CSP is only valid for OUT endpoints

2016-10-31 Thread Felipe Balbi
CSP bit is only valid for OUT endpoints. Synopsys databook is unclear if HW ignores CSP for IN endpoints (chances are, it does) but to avoid problems, let's make sure to set CSP only when valid to do so. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 3 ++- 1 file changed, 2 inserti

[PATCH 63/82] usb: dwc3: core: add dwc3_get_properties()

2016-10-31 Thread Felipe Balbi
This helper will be responsible for reading and parsing our properties. No functional changes in this patch, cleanup only. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.c | 90 +++-- 1 file changed, 49 insertions(+), 41 deletions(-) diff --git

[PATCH 54/82] usb: dwc3: gadget: remove unused 'first_trb_index'

2016-10-31 Thread Felipe Balbi
Recent changes have turned this field obsolete. Remove it. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h | 2 -- drivers/usb/dwc3/gadget.c | 1 - 2 files changed, 3 deletions(-) diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 18e4c09ae286..bdd37871fc6c 100644 --

[PATCH 60/82] usb: dwc3: core: introduce dwc3_core_is_valid()

2016-10-31 Thread Felipe Balbi
This little helper will be used to make sure we're dealing with a valid Synopsys DWC3 or DWC3.1 core. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.c | 32 ++-- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/u

[PATCH 77/82] usb: dwc3: gadget: tracking per-TRB remaining bytes

2016-10-31 Thread Felipe Balbi
This will give us a simpler way of figuring out how many bytes were left in each TRB. It's useful for cases where we queue only part of an SG-list due to amount of available TRBs at the time of kicking the transfer. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.h | 2 ++ drivers/usb/d

[PATCH 47/82] usb: dwc3: gadget: offset Start Transfer latency for bulk EPs

2016-10-31 Thread Felipe Balbi
We can offset the latency of a full Start Transfer command - where we _must_ poll for its completion - to usb_ep_enable() time. This means that once requests start showing up from the gadget driver, we can rely on No Response Update Transfer command - where we don't need to poll for completion. Th

[PATCH 79/82] usb: dwc3: gadget: stop touching HWO TRBs

2016-10-31 Thread Felipe Balbi
Say we have three requests prepared to the HW (reqA, reqB, and reqC). All of them are composed of SG-lists with several entries and they all requests interrupt only on last TRBs of the SG-list. When we get interrupt for reqA, it could be that reqB is already half-way transferred and some of its TR

[PATCH 57/82] usb: dwc3: gadget: never ever kill the machine

2016-10-31 Thread Felipe Balbi
We should never kill the machine just because some USB endpoint type is wrong. WARN about it and move on. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index a1

[PATCH 76/82] usb: dwc3: gadget: cope with XferNotReady before usb_ep_queue()

2016-10-31 Thread Felipe Balbi
If XferNotReady comes before usb_ep_queue() we will set our PENDING request flag and wait for a request. However, originally, we were assuming usb_ep_queue() would always happen before our first XferNotReady and that causes a corner case where we could try to issue ENDTRANSFER command before STARTT

[PATCH 59/82] usb: dwc3: Add support for device L1 exit

2016-10-31 Thread Felipe Balbi
From: John Youn For the usb31 IP and from version 2.90a of the usb3 IP, the core supports HW exit from L1 in HS. Enable it, otherwise the controller may never exit from LPM to do a transfer. Signed-off-by: John Youn Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.c | 10 ++ driv

[PATCH 81/82] usb: dwc3: pci: add a private driver structure

2016-10-31 Thread Felipe Balbi
We'll be tracking a little more information for PCI drivers, it's about time we add a private structure for that. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/dwc3-pci.c | 49 +++-- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/driver

[PATCH 71/82] usb: gadget: f_fs: use complete() instead complete_all()

2016-10-31 Thread Felipe Balbi
From: Daniel Wagner There is only one waiter for the completion, therefore there is no need to use complete_all(). Let's make that clear by using complete() instead of complete_all(). The usage pattern of the completion is: waiter context waker context reinit_completi

[PATCH 62/82] usb: dwc3: core: remove unnecessary alignment

2016-10-31 Thread Felipe Balbi
Kernel will give us page aligned memory anyway. 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 e65f30afb89a..1f33abf21e0f 100644 --- a/drivers/usb/dwc3/cor

[PATCH 46/82] usb: dwc3: trace: pretty print high-bandwidth transfers too

2016-10-31 Thread Felipe Balbi
In case of periodic transfers, let's pretty print the size field as a multiplier followed by length, such as : 3x 1024 instead of: 33555456 Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/trace.h | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-)

[PATCH 64/82] usb: dwc3: gadget: purge dwc3_stop_active_transfers()

2016-10-31 Thread Felipe Balbi
That function is unnecessarily called from dwc3_gadget_reset_interrupt(). Gadget drivers (and thus, functions) are required to dequeue all pending requests when they get notified about a USB Bus Reset. Trying to make sure there are no pending requests only serves the purpose of working around poss

[PATCH 61/82] usb: dwc3: core: introduce dwc3_core_setup_global_control()

2016-10-31 Thread Felipe Balbi
This little helper will be used to setup anything related to GCTL register. There are no functional changes, this is a cleanup only patch. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.c | 90 ++--- 1 file changed, 48 insertions(+), 42 deletion

[PATCH 45/82] usb: gadget: udc: mv: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/mv_udc_core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/driver

[PATCH 75/82] usb: dwc3: gadget: wait for End Transfer to complete

2016-10-31 Thread Felipe Balbi
From: Baolin Wang Instead of just delaying for 100us, we should actually wait for End Transfer Command Complete interrupt before moving on. Note that this should only be done if we're dealing with one of the core revisions that actually require the interrupt before moving on. [ felipe.ba...@linu

[PATCH 43/82] usb: ip: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Cc: Valentina Manea Cc: Shuah Khan Cc: Signed-off-by: Felipe Balbi --- drivers/usb/usbip/vudc_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[PATCH 80/82] usb: dwc3: gadget: always kick if num_pending_sgs > 0

2016-10-31 Thread Felipe Balbi
When we get a half-way processed request, we should make sure to try to prepare further TRBs for it or for any possibly queued up request held in our pending_list. This will make sure our controller is kept busy for as long as possible. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c |

[PATCH 72/82] usb: gadget: NCM: link socket buffers to the device for tx packets

2016-10-31 Thread Felipe Balbi
From: Torsten Polle Socket buffers should be linked to the (network) device that allocated the buffers. Signed-off-by: Torsten Polle Signed-off-by: Harish Jenny K N Signed-off-by: Felipe Balbi --- drivers/usb/gadget/function/f_ncm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/driv

[PATCH 69/82] usb: dwc3: cleanup with list_first_entry_or_null()

2016-10-31 Thread Felipe Balbi
From: Masahiro Yamada The combo of list_empty() check and return list_first_entry() can be replaced with list_first_entry_or_null(). Signed-off-by: Masahiro Yamada Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.h | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a

[PATCH 65/82] usb: dwc3: gadget: don't clear RUN/STOP when it's invalid to do so

2016-10-31 Thread Felipe Balbi
From: Baolin Wang When we change the USB function with configfs dynamically, we possibly met this situation: one core is doing the control transfer, another core is trying to unregister the USB gadget from userspace, we must wait for completing this control tranfer, or it will hang the controller

[PATCH 73/82] usb: gadget: u_ether: link socket buffers to the device for received packets

2016-10-31 Thread Felipe Balbi
From: Torsten Polle Socket buffers should be linked to the (network) device that allocated the buffers. __netdev_alloc_skb performs this task. Signed-off-by: Torsten Polle Signed-off-by: Jim Baxter Signed-off-by: Harish Jenny K N Signed-off-by: Felipe Balbi --- drivers/usb/gadget/function/u

[PATCH 78/82] usb: dwc3: gadget: always try to prepare on started_list first

2016-10-31 Thread Felipe Balbi
In cases where we're given an SG-list which is longer than the amount of currently available TRBs, we will be left with the same request on started_list and we should prioritize that request over possible new requests on pending_list. That's a way to guarantee requests complete in order. Signed-of

[PATCH 44/82] usb: gadget: udc: fsl: remove unnecessary & operation

2016-10-31 Thread Felipe Balbi
Now that usb_endpoint_maxp() only returns the lowest 11 bits from wMaxPacketSize, we can remove the & operation from this driver. Cc: Li Yang Cc: Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/fsl_udc_core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/gadget/udc/fsl_

[PATCH 74/82] usb: gadget: NCM: differentiate consumed packets from dropped packets

2016-10-31 Thread Felipe Balbi
From: Torsten Polle dev_kfree_skb_any() is used to free packets that are dropped by the network stack. Therefore the function should not be used for packets that have been successfully processed by the network stack. Instead dev_consume_skb_any() has to be used for such consumed packets. This se

[PATCH 82/82] usb: dwc3: pci: call _DSM for suspend/resume

2016-10-31 Thread Felipe Balbi
Intel's BXT devices need to execute a _DSM method during {runtime_,}{suspend,resume} in order to get a chunk of dwc3 to power gate and save some extra power. Let's do that now. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/Kconfig| 2 +- drivers/usb/dwc3/dwc3-pci.c | 73

[PATCH 53/82] usb: dwc3: ep0: simplify dwc3_ep0_handle_feature()

2016-10-31 Thread Felipe Balbi
By extracting smaller functions from dwc3_ep0_handle_feature(), it becomes far easier to understand what's going on. Cleanup only, no functional changes. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/ep0.c | 256 +++-- 1 file changed, 163 insertions

[PATCH 52/82] usb: dwc3: host: extract dwc3_host_get_irq()

2016-10-31 Thread Felipe Balbi
Cleanup only, no functional changes. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/host.c | 68 + 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index f6533c68fed1..ed824647ead8

[PATCH 67/82] usb: Convert pr_warning to pr_warn

2016-10-31 Thread Felipe Balbi
From: Joe Perches Use the more common logging mechanism. Miscellanea: o Realign multiline statements o Coalesce format Acked-by: Robert Jarzmik Acked-by: Nicolas Ferre Signed-off-by: Joe Perches Signed-off-by: Felipe Balbi --- drivers/usb/gadget/function/rndis.c | 9 - driver

[PATCH 50/82] usb: dwc3: trace: add a proper tracepoint for reg accessors

2016-10-31 Thread Felipe Balbi
We want to reduce the usage of dwc3_trace() in favor of proper tracepoints which can be enabled/disabled by the user. Let's start with our register accessors. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/io.h| 6 ++ drivers/usb/dwc3/trace.h | 35 ++-

[PATCH 56/82] usb: dwc3: gadget: only interrupt on short if short_not_ok is set

2016-10-31 Thread Felipe Balbi
We don't need to know about short packets unless gadget driver told us it's not ok to see them on the bus. In the normal situation we can continue processing the list of requests if we get a Short packet. Also, note that we're making sure ISP is only set for OUT endpoints, where that setting is va

[PATCH 51/82] usb: dwc3: gadget: extract dwc3_gadget_get_irq()

2016-10-31 Thread Felipe Balbi
Cleanup only, no functional changes. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 62 +-- 1 file changed, 38 insertions(+), 24 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index c692aafa7397..c0011174a

Re: [PATCH 75/82] usb: dwc3: gadget: wait for End Transfer to complete

2016-10-31 Thread Felipe Balbi
Hi Baolin, Felipe Balbi writes: > From: Baolin Wang > > Instead of just delaying for 100us, we should > actually wait for End Transfer Command Complete > interrupt before moving on. Note that this should > only be done if we're dealing with one of the core > revisions that actually require the

Re: [PATCH 22/82] usb: gadget: udc: gr: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Sergei Shtylyov
On 10/31/2016 1:48 PM, Felipe Balbi wrote: We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/gr_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/

Re: [PATCH v2 0/3] usb: trivial cleanups with list_first_entry_or_null()

2016-10-31 Thread Felipe Balbi
Hi, Masahiro Yamada writes: > Hello Felipe, > > If this series looks good, can you pick it up please? it's in my testing/next branch. Has been there for a while ;-) -- balbi signature.asc Description: PGP signature

Re: [PATCH v2 0/3] usb: trivial cleanups with list_first_entry_or_null()

2016-10-31 Thread Masahiro Yamada
Hi Felipe, >> >> If this series looks good, can you pick it up please? > > it's in my testing/next branch. Has been there for a while ;-) Good. Thanks for taking care of it! -- Best Regards Masahiro Yamada -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body o

Re: [RFC][PATCH] usb: dwc2: Make sure we disconnect the gadget state on reset

2016-10-31 Thread Felipe Balbi
Hi, John Stultz writes: > I had seen some odd behavior with HiKey's usb-gadget interface > that I finally seemed to have chased down. Basically every other > time I pluged in the OTG port, the gadget interface would > properly initialize. The other times, I'd get a big WARN_ON > in dwc2_hsotg_in

Re: [PATCH v18 0/4] Introduce usb charger framework to deal with the usb gadget power negotation

2016-10-31 Thread Baolin Wang
On 29 October 2016 at 01:03, Mark Brown wrote: > On Fri, Oct 28, 2016 at 08:51:41PM +0800, Baolin Wang wrote: >> On 28 October 2016 at 06:00, NeilBrown wrote: > >> > 1/ I think we agreed that it doesn't make sense for there to be >> > two chargers registered in a system. > >> Yes, until now... >

Re: [PATCH 75/82] usb: dwc3: gadget: wait for End Transfer to complete

2016-10-31 Thread Baolin Wang
Hi Feilpe, On 31 October 2016 at 18:55, Felipe Balbi wrote: > > Hi Baolin, > > Felipe Balbi writes: >> From: Baolin Wang >> >> Instead of just delaying for 100us, we should >> actually wait for End Transfer Command Complete >> interrupt before moving on. Note that this should >> only be done if

[balbi-usb:testing/next 49/82] drivers/usb/dwc3/dwc3-st.c:328:2: error: implicit declaration of function 'pinctrl_pm_select_sleep_state'

2016-10-31 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git testing/next head: 391ea04dea216a223b8dea3a0a832ff83884db1b commit: 6a58c79df975feebfc5bd338b9fb0c9bc61081e5 [49/82] usb: dwc3: Kconfig: allow all glues to build if COMPILE_TEST config: powerpc-allyesconfig (attached as .conf

[PATCH v1] usb: dwc3: gadget: wait for End Transfer to complete

2016-10-31 Thread Baolin Wang
Instead of just delaying for 100us, we should actually wait for End Transfer Command Complete interrupt before moving on. Note that this should only be done if we're dealing with one of the core revisions that actually require the interrupt before moving on. [ felipe.ba...@linux.intel.com: minor i

Re: musb RPM sleep-while-atomic in 4.9-rc1

2016-10-31 Thread Johan Hovold
On Fri, Oct 28, 2016 at 11:13:19AM -0700, Tony Lindgren wrote: > * Johan Hovold [161028 02:45]: > > On Thu, Oct 27, 2016 at 12:15:52PM -0700, Tony Lindgren wrote: > > > * Johan Hovold [161027 11:46]: > > > > But then this looks like it could trigger an ABBA deadlock as musb->lock > > > > is held

Re: [PATCH 22/82] usb: gadget: udc: gr: make use of new usb_endpoint_maxp_mult()

2016-10-31 Thread Felipe Balbi
Hi, Sergei Shtylyov writes: > On 10/31/2016 1:48 PM, Felipe Balbi wrote: > >> We have introduced a helper to calculate multiplier >> value from wMaxPacketSize. Start using it. >> >> Signed-off-by: Felipe Balbi >> --- >> drivers/usb/gadget/udc/gr_udc.c | 2 +- >> 1 file changed, 1 insertion(+),

Re: [PATCH v1] usb: dwc3: gadget: wait for End Transfer to complete

2016-10-31 Thread Felipe Balbi
Hi, Baolin Wang writes: > Instead of just delaying for 100us, we should > actually wait for End Transfer Command Complete > interrupt before moving on. Note that this should > only be done if we're dealing with one of the core > revisions that actually require the interrupt before > moving on. >

[no subject]

2016-10-31 Thread Debra_Farmer/SSB/HIDOE
I am Mrs. Gu Kailai and i intend to make a DONATION. Contact my personal E-mail Via: mrsgukai...@post.cz for more details: -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/m

Re: [PATCH 51/82] usb: dwc3: gadget: extract dwc3_gadget_get_irq()

2016-10-31 Thread John Youn
On 10/31/2016 3:51 AM, Felipe Balbi wrote: > Cleanup only, no functional changes. > > Signed-off-by: Felipe Balbi > --- > drivers/usb/dwc3/gadget.c | 62 > +-- > 1 file changed, 38 insertions(+), 24 deletions(-) > > diff --git a/drivers/usb/dwc3/gadg

  1   2   >