Re: [PATCH 1/1] net: pegasus: remove dead coding

2016-05-18 Thread Petko Manolov
On 16-05-18 02:13:30, Heinrich Schuchardt wrote: > (!count || count < 4) is always true. > So let's remove the coding which is dead at least since 2005. You may want to reconsider the above statement. Just assume that 'count' is typically between 56 and 1514 bytes. Petko >

Re: [1/1] net: pegasus: remove dead coding

2016-05-18 Thread Guenter Roeck
On Wed, May 18, 2016 at 02:13:30AM +0200, Heinrich Schuchardt wrote: > (!count || count < 4) is always true. Even if count >= 4 ? Guenter > So let's remove the coding which is dead at least since 2005. > > Signed-off-by: Heinrich Schuchardt > > --- >

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

2016-05-18 Thread Felipe Balbi
Hi John, 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

Re: [1/1] net: pegasus: remove dead coding

2016-05-18 Thread Oliver Neukum
On Tue, 2016-05-17 at 23:30 -0700, Guenter Roeck wrote: > On Wed, May 18, 2016 at 02:13:30AM +0200, Heinrich Schuchardt wrote: > > (!count || count < 4) is always true. > > Even if count >= 4 ? The check for !count is redundant, though. Gcc, however, will surely simplify the expression.

Re: UBSAN whinge in ihci-hub.c

2016-05-18 Thread Andrey Ryabinin
2016-05-18 1:16 GMT+03:00 Greg Kroah-Hartman : > On Tue, May 17, 2016 at 05:52:40PM -0400, Valdis Kletnieks wrote: >> So, not content in the amount of breakage I generate already, I >> compiled with UBSAN enabled... >> >> The immediately relevant part: >> >> [

Re: [PATCHv2 00/15] Get MUSB PM runtime working again

2016-05-18 Thread Alan Stern
On Wed, 18 May 2016, Tony Lindgren wrote: > * Bin Liu [160518 10:37]: > > I think I found the problem. Before having the offending patch, > > musb_gadget_pullup() got called by musb_gadget_start(), then pm_suspend > > immediately (~2us) happens, and musb_save_context() backs up

Re: UBSAN whinge in ihci-hub.c

2016-05-18 Thread Alan Stern
On Wed, 18 May 2016, Andrey Ryabinin wrote: > 2016-05-18 19:09 GMT+03:00 Alan Stern : > > On Wed, 18 May 2016, Andrey Ryabinin wrote: > > > >> 2016-05-18 17:40 GMT+03:00 Alan Stern : > >> > >> > All right, I'm getting very tired of all these

Re: [PATCH] usb: echi-hcd: Add register access check in shutdown

2016-05-18 Thread Alan Stern
On Wed, 18 May 2016, Srinivas Kandagatla wrote: > On 18/05/16 15:56, Alan Stern wrote: > > This doesn't seem like the right place. What you really should do is > > skip calling ehci_silence_controller() if the hardware isn't > > accessible. That's where the hardware gets touched, not in > >

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

2016-05-18 Thread John Youn
On 5/18/2016 3:44 AM, John Keeping wrote: > On Tue, 17 May 2016 16:16:23 -0700, John Youn wrote: > >> 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

Re: usb: dwc2: regression on MyBook Live Duo / Canyonlands since 4.3.0-rc4

2016-05-18 Thread Christian Lamparter
On Tuesday, May 17, 2016 04:50:48 PM John Youn wrote: > On 5/14/2016 6:11 AM, Christian Lamparter wrote: > > On Thursday, May 12, 2016 11:40:28 AM John Youn wrote: > >> On 5/12/2016 6:30 AM, Christian Lamparter wrote: > >>> On Thursday, May 12, 2016 01:55:44 PM Arnd Bergmann wrote: > On

Re: [PATCHv2 00/15] Get MUSB PM runtime working again

2016-05-18 Thread Bin Liu
On Wed, May 18, 2016 at 12:12:40PM -0700, Tony Lindgren wrote: > * Alan Stern [160518 11:47]: > > On Wed, 18 May 2016, Tony Lindgren wrote: > > > > > * Bin Liu [160518 10:37]: > > > > I think I found the problem. Before having the offending patch, > > >

[RFC 8/8] usb: phy: msm: disable regulator for remove()

2016-05-18 Thread Arnd Bergmann
It seems odd that this driver explicitly enables the vddcx regulator on probe along with the other regulators, but doesn't disable it again when the device is removed. This changes the remove callback to handle all three regulators the same way and disable them in the end. Signed-off-by: Arnd

[RFC 6/8] usb: phy: qcom: use bulk regulator interfaces

2016-05-18 Thread Arnd Bergmann
When build-testing the phy-msm-usb driver, we can run into a gcc warning: drivers/usb/phy/phy-msm-usb.c: In function 'msm_otg_probe': drivers/usb/phy/phy-msm-usb.c:1735:14: error: 'regs[0].consumer' may be used uninitialized in this function [-Werror=maybe-uninitialized]

[RFC 0/8] usb: phy: msm: various cleanups

2016-05-18 Thread Arnd Bergmann
I stumbled over this warning last week, which showed up after I had removed an incorrect patch from my randconfig build setup: drivers/usb/phy/phy-msm-usb.c: In function 'msm_otg_probe': drivers/usb/phy/phy-msm-usb.c:1735:14: error: 'regs[0].consumer' may be used uninitialized in this function

[RFC 2/8] usb: ehci-msm: call usb_phy_init instead of open-coding it

2016-05-18 Thread Arnd Bergmann
While looking at the phy-msm-usb driver, I noticed that its registers are also accessed by teh ehci-msm driver, basically duplicating part of the logic that is already present in the phy driver. This removes the duplicate code from the ehci driver and instead calls the usb_phy_init() function. I

[RFC 3/8] usb: chipidea: msm: remove open-coded phy init

2016-05-18 Thread Arnd Bergmann
After commit 233c7daf4eec ("usb: chipidea: msm: Initialize PHY on reset event"), we always call usb_phy_init() when receiving a CI_HDRC_CONTROLLER_RESET_EVENT event, but we also set the USB_AHBBURST and USB_AHBMODE registers to the same values that the reset function does. This removes the

[RFC 7/8] usb: phy: msm: remove v1p8/v3p3 voltage setting

2016-05-18 Thread Arnd Bergmann
As pointed out by Mark Brown, regulators that are always set to a fixed voltage range should be initialized from the values in the device tree rather than having client drivers set the voltage manually. This removes the msm_hsusb_ldo_init() function that adapts the voltage on the fixed 1.8v and

[RFC 5/8] usb: phy: msm: move register definitions into driver

2016-05-18 Thread Arnd Bergmann
The linux/usb/msm_hsusb_hw.h header is now only included by one file and can be merged into that for simplicity. Signed-off-by: Arnd Bergmann --- drivers/usb/phy/phy-msm-usb.c| 56 +- include/linux/usb/msm_hsusb_hw.h | 74

[RFC 4/8] usb: phy: move TCSR driver into new file

2016-05-18 Thread Arnd Bergmann
The phy-msm-usb driver open-codes access to the Top Control and Status Register area for setting the phy mode, without any serialization or checks if these registers are actually present. This moves the hack to a more prominent location in the hope that it can eventually get cleaned up.

[RFC 1/8] usb: phy: move msm_hsusb.h into driver

2016-05-18 Thread Arnd Bergmann
As a preparation for another cleanup, this moves the header file for the phy-msm-usb driver into the driver itself. No other file includes it any more, and we don't really want it in the global namespace anyway. Signed-off-by: Arnd Bergmann --- drivers/usb/phy/phy-msm-usb.c | 178

Re: usb: dwc2: regression on MyBook Live Duo / Canyonlands since 4.3.0-rc4

2016-05-18 Thread John Youn
On 5/18/2016 12:15 PM, Christian Lamparter wrote: > On Tuesday, May 17, 2016 04:50:48 PM John Youn wrote: >> On 5/14/2016 6:11 AM, Christian Lamparter wrote: >>> On Thursday, May 12, 2016 11:40:28 AM John Youn wrote: On 5/12/2016 6:30 AM, Christian Lamparter wrote: > On Thursday, May 12,

Re: [PATCH 07/13] usb: dwc2: gadget: Corrected interval calculation

2016-05-18 Thread John Youn
On 5/18/2016 4:32 AM, Sergei Shtylyov wrote: > Hello. > > On 5/18/2016 2:16 AM, John Youn wrote: > >> From: Vardan Mikayelyan >> >> According "Table 9-13" of USB2 Specification > > According to. > >> For full-/high-speed isochronous endpoints, bInterval value >>

RE: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-18 Thread Du, Changbin
> >> thanks Alan Stern and Michal. > >> Here just have a comment - the buffered data need be dropped when > the > >> epfile is closed, because it means the session is terminated. > > > > I blame that on sleep deprivation. Another issue is what to do when > > endpoint is disabled. Should the

RE: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-18 Thread Du, Changbin
> On Wed, May 18 2016, Felipe Balbi wrote: > > we've been through this before. This needs to be done at the gadget > > layer. Gadget driver can over-allocate ahead of time if > > gadget->quirk_ep_out_aligned_size is true, then we avoid memcpy() at > > the UDC driver level. > > Right, all right,

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

2016-05-18 Thread Paul Zimmerman
Felipe Balbi writes: > If we're going to issue a Update Transfer command, > let's clear LST bit from previous TRB. This will let > us continue processing TRBs and convert previous IRQ > into XferInProgress, instead of XferComplete. > > Signed-off-by: Felipe Balbi

Re: [PATCH 10/22] usb: dwc3: gadget: initialize NUMP based on RxFIFO Size

2016-05-18 Thread John Youn
On 5/18/2016 1:35 AM, Felipe Balbi wrote: > 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

Re: [PATCH 1/1] net: pegasus: simplify logical constraint

2016-05-18 Thread Petko Manolov
On 16-05-18 20:40:51, Heinrich Schuchardt wrote: > If !count is true, count < 4 is also true. Yep, you're right. However, gcc optimizes away the first condition. What you really got me to think about is whether 4 is the right number. I guess i shall refer to the HW documentation.

[PATCH] usb: quirks: Add no-lpm quirk for Acer C120 LED Projector

2016-05-18 Thread Hans de Goede
The Acer C120 LED Projector is a USB-3 connected pico projector which takes both its power and video data from USB-3. In combination with some hubs this device does not play well with lpm, so disable lpm for it. Signed-off-by: Hans de Goede --- drivers/usb/core/quirks.c |

Re: UBSAN whinge in ihci-hub.c

2016-05-18 Thread Oliver Neukum
On Wed, 2016-05-18 at 10:40 +0300, Andrey Ryabinin wrote: > 2016-05-18 1:16 GMT+03:00 Greg Kroah-Hartman : > > On Tue, May 17, 2016 at 05:52:40PM -0400, Valdis Kletnieks wrote: > >> So, not content in the amount of breakage I generate already, I > >> compiled with UBSAN

Re: UBSAN whinge in ihci-hub.c

2016-05-18 Thread Andrey Ryabinin
2016-05-18 11:18 GMT+03:00 Oliver Neukum : > On Wed, 2016-05-18 at 10:40 +0300, Andrey Ryabinin wrote: >> 2016-05-18 1:16 GMT+03:00 Greg Kroah-Hartman : >> > On Tue, May 17, 2016 at 05:52:40PM -0400, Valdis Kletnieks wrote: >> >> So, not content in the

Re: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-18 Thread Michal Nazarewicz
On Tue, May 17 2016, Changbin Du wrote: >> There appears to be no kfifo support for iov_iter though, so I just went >> with a simple buffer. >> >> I haven’t looked at the patch too carefully so this is an RFC rather >> than an actual patch at this point. It does compile at least. >> >>

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Baolin Wang
Hi Felipe, On 17 May 2016 at 18:47, Baolin Wang wrote: > On 17 May 2016 at 17:25, Felipe Balbi wrote: >> >> Hi, >> >> Baolin Wang writes: >>> Make sense. >> >> cool, if you wanna work on it, let me know and I can

Re: UBSAN whinge in ihci-hub.c

2016-05-18 Thread Andrey Ryabinin
2016-05-18 13:19 GMT+03:00 Oliver Neukum : > On Wed, 2016-05-18 at 12:16 +0300, Andrey Ryabinin wrote: >> 2016-05-18 11:18 GMT+03:00 Oliver Neukum : >> > On Wed, 2016-05-18 at 10:40 +0300, Andrey Ryabinin wrote: >> >> 2016-05-18 1:16 GMT+03:00 Greg Kroah-Hartman

Re: [PATCH v8 13/14] usb: gadget: udc: adapt to OTG core

2016-05-18 Thread Roger Quadros
On 18/05/16 06:18, Peter Chen wrote: > On Mon, May 16, 2016 at 12:51:53PM +0300, Roger Quadros wrote: >> On 16/05/16 12:23, Peter Chen wrote: >>> On Mon, May 16, 2016 at 11:26:57AM +0300, Roger Quadros wrote: Hi, On 16/05/16 10:02, Peter Chen wrote: > On Fri, May 13, 2016 at

Re: [PATCH v8 08/14] usb: otg: add OTG/dual-role core

2016-05-18 Thread Roger Quadros
Hi Peter, On 18/05/16 10:45, Peter Chen wrote: > > > On Mon, May 16, 2016 at 5:00 PM, Roger Quadros > wrote: > > On 13/05/16 13:03, Roger Quadros wrote: > > It provides APIs for the following tasks > > > > - Registering an OTG/dual-role

Re: [PATCH v8 13/14] usb: gadget: udc: adapt to OTG core

2016-05-18 Thread Roger Quadros
On 18/05/16 16:12, Jun Li wrote: > Hi > >> -Original Message- >> From: Roger Quadros [mailto:rog...@ti.com] >> Sent: Wednesday, May 18, 2016 8:43 PM >> To: Jun Li ; Peter Chen >> Cc: peter.c...@freescale.com; ba...@kernel.org; t...@atomide.com; >>

Re: [PATCH v8 13/14] usb: gadget: udc: adapt to OTG core

2016-05-18 Thread Roger Quadros
On 17/05/16 11:28, Jun Li wrote: > Hi Roger, > >> -Original Message- >> From: Roger Quadros [mailto:rog...@ti.com] >> Sent: Tuesday, May 17, 2016 4:09 PM >> To: Jun Li ; Peter Chen >> Cc: peter.c...@freescale.com; ba...@kernel.org; t...@atomide.com;

Slow writes with dd on Lexar JumpDrive P20 64GB flash drives connected via Intel USB 3.0 host controllers

2016-05-18 Thread Michael Schaller
[1.] One line summary of the problem: Slow writes with dd on Lexar JumpDrive P20 64GB flash drives connected via Intel USB 3.0 host controllers. [2.] Full description of the problem/report: Writes on Lexar JumpDrive P20 64GB flash drives are unexpectedly slow. With dd we are seeing 45 MB/s while

Re: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-18 Thread Michal Nazarewicz
On Wed, May 18 2016, Felipe Balbi wrote: > we've been through this before. This needs to be done at the gadget > layer. Gadget driver can over-allocate ahead of time if > gadget->quirk_ep_out_aligned_size is true, then we avoid memcpy() at > the UDC driver level. Right, all right, so let’s look

RE: [PATCH v8 13/14] usb: gadget: udc: adapt to OTG core

2016-05-18 Thread Jun Li
Hi > -Original Message- > From: Roger Quadros [mailto:rog...@ti.com] > Sent: Wednesday, May 18, 2016 8:43 PM > To: Jun Li ; Peter Chen > Cc: peter.c...@freescale.com; ba...@kernel.org; t...@atomide.com; > gre...@linuxfoundation.org;

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Felipe Balbi
Hi, Baolin Wang writes: >>> @@ -1485,16 +1490,11 @@ static int dwc3_gadget_run_stop(struct dwc3 >>> *dwc, int is_on, int suspend) >>> { >>> u32 reg; >>> u32 timeout = 500, i; >>> >>> + if

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

2016-05-18 Thread John Keeping
On Tue, 17 May 2016 16:16:23 -0700, John Youn wrote: > 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

Re: [PATCH 07/13] usb: dwc2: gadget: Corrected interval calculation

2016-05-18 Thread Sergei Shtylyov
Hello. On 5/18/2016 2:16 AM, John Youn wrote: From: Vardan Mikayelyan According "Table 9-13" of USB2 Specification According to. For full-/high-speed isochronous endpoints, bInterval value must be in the range from 1 to 16. The bInterval value

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Baolin Wang
On 18 May 2016 at 19:21, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: >> @@ -1748,15 +1754,25 @@ static int dwc3_gadget_start(struct usb_gadget >> *g, >> * even though host mode might be active. Don't actually perform >>

Re: [PATCH 06/13] usb: dwc2: gadget: Add dwc2_gadget_incr_frame_num()

2016-05-18 Thread Sergei Shtylyov
Hello. On 5/18/2016 2:16 AM, John Youn wrote: From: Vardan Mikayelyan Increases and checks targeted frame number of current ep if overrun happened, sets flag and masks with DSTS_SOFFN_LIMIT Added following fields to struct dwc2_hsotg_ep -target_frame: Targeted frame

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Felipe Balbi
Hi, Baolin Wang writes: >>> Baolin Wang writes: Make sense. >>> >>> cool, if you wanna work on it, let me know and I can give some details >>> of what I have in mind. >> >> Could you explain details to me, and I wanna

Re: UBSAN whinge in ihci-hub.c

2016-05-18 Thread Oliver Neukum
On Wed, 2016-05-18 at 12:16 +0300, Andrey Ryabinin wrote: > 2016-05-18 11:18 GMT+03:00 Oliver Neukum : > > On Wed, 2016-05-18 at 10:40 +0300, Andrey Ryabinin wrote: > >> 2016-05-18 1:16 GMT+03:00 Greg Kroah-Hartman : > >> > On Tue, May 17, 2016 at

Re: [PATCH] usb: gadget: f_fs: report error if excess data received

2016-05-18 Thread Felipe Balbi
Hi, Michal Nazarewicz writes: > On Tue, May 17 2016, Changbin Du wrote: >>> There appears to be no kfifo support for iov_iter though, so I just went >>> with a simple buffer. >>> >>> I haven’t looked at the patch too carefully so this is an RFC rather >>> than an actual

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Baolin Wang
Hi, On 18 May 2016 at 18:22, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: @@ -1485,16 +1490,11 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend) { u32 reg;

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Felipe Balbi
Hi, Baolin Wang writes: > @@ -1748,15 +1754,25 @@ static int dwc3_gadget_start(struct usb_gadget *g, > * even though host mode might be active. Don't actually perform > * device-specific initialization until device mode is activated. >

[PATCH 1/2] usb: dwc3: fix for the isoc transfer EP_BUSY flag

2016-05-18 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 2/2] usb: dwc3: gadget: fix for possible endpoint disable race

2016-05-18 Thread Felipe Balbi
when we call dwc3_gadget_giveback(), we end up releasing our controller's lock. Another thread could get scheduled and disable the endpoint, subsequently setting dep->endpoint.desc to NULL. In that case, we would end up dereferencing a NULL pointer which would result in a Kernel Oops. Let's avoid

Re: [PATCH] dwc3: gadget: Defer starting the gadget device until gadget is power on

2016-05-18 Thread Baolin Wang
On 18 May 2016 at 18:12, Felipe Balbi wrote: > > Hi, > > Baolin Wang writes: Baolin Wang writes: > Make sense. cool, if you wanna work on it, let me know and I can give some details of what

[PATCH 15/22] usb: dwc3: gadget: switch over to spin_lock()

2016-05-18 Thread Felipe Balbi
we *know* that our dwc3 interrupt is masked because we masked it in the hardirq handler. This means we don't need to disable all of current cpu's interrupts. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 5 ++--- 1 file changed, 2 insertions(+), 3

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

2016-05-18 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 11/22] usb: dwc3: gadget: clear LST from previous TRB on Update Transfer

2016-05-18 Thread Felipe Balbi
If we're going to issue a Update Transfer command, let's clear LST bit from previous TRB. This will let us continue processing TRBs and convert previous IRQ into XferInProgress, instead of XferComplete. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 32

[PATCH 04/22] usb: dwc3: gadget: prepare TRBs on update transfers too

2016-05-18 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 09/22] usb: dwc3: gadget: split __dwc3_gadget_kick_transfer()

2016-05-18 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 02/22] usb: dwc3: gadget: fix gadget suspend/resume

2016-05-18 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 17/22] usb: dwc3: core: re-factor init and exit paths

2016-05-18 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

Re: [PATCH] cdc-wdm: fix "out-of-sync" due to missing notifications

2016-05-18 Thread Oliver Neukum
On Wed, 2016-05-18 at 01:39 +0200, Bjørn Mork wrote: > Oliver Neukum writes: > > On Tue, 2016-05-17 at 21:24 +0200, Bjørn Mork wrote: > >> Oliver Neukum writes: > >> > >> > On Fri, 2016-05-13 at 18:59 +0200, Bjørn Mork wrote: > >> >> Bjørn Mork

[PATCH 12/22] usb: dwc3: gadget: start bulk endpoints more frequently

2016-05-18 Thread Felipe Balbi
Instead of waiting for !BUSY, we can kick bulk endpoints more frequently and rely on the fact that __dwc3_gadget_kick_transfer() will use Update Transfer if BUSY flag is set. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 47

[PATCH 14/22] usb: dwc3: gadget: add a pointer to endpoint registers

2016-05-18 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/22] usb: dwc3 / f_mass_storage: misc changes

2016-05-18 Thread Felipe Balbi
Hi folks, these last couple weeks I've been working on further improving dwc3 throughput. Also worked a little on suspend/resume. The result of this work is here. Note that dwc3's transfer handling is a lot simpler and easier to follow. I can reach up to 45MiB/sec in HS with Mass Storage gadget

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

2016-05-18 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 13/22] usb: dwc3: gadget: pass dep as argument to endpoint command

2016-05-18 Thread Felipe Balbi
In all call sites of dwc3_send_gadget_ep_cmd() we already had a valid dep pointer, so instead of passing dwc and dep->number, which would be used to fetch the same pointer we already had, just pass dep directly. In other words, we're changing: struct dwc3_ep *dep = dwc[dep->number]; to

[PATCH 10/22] usb: dwc3: gadget: initialize NUMP based on RxFIFO Size

2016-05-18 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 03/22] usb: dwc3: core: get rid of DWC3_PM_OPS macro

2016-05-18 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 05/22] usb: dwc3: gadget: simplify __dwc3_gadget_kick_transfer()

2016-05-18 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 01/22] usb: dwc3: gadget: re-factor ->udc_start and ->udc_stop

2016-05-18 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 16/22] usb: dwc3: core: move fladj to dwc3 structure

2016-05-18 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 22/22] usb: gadget: storage: increase maximum storage num buffers

2016-05-18 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 06/22] usb: dwc3: gadget: rely on sg_is_last() and list_is_last()

2016-05-18 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 18/22] usb: dwc3: core: simplify suspend/resume operations

2016-05-18 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 21/22] usb: gadget: storage: get rid of fsg_num_buffers_validate()

2016-05-18 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 | 18 +- 1 file changed, 1

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

2016-05-18 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

Re: [1/1] net: pegasus: remove dead coding

2016-05-18 Thread Petko Manolov
On 16-05-18 09:15:40, Oliver Neukum wrote: > On Tue, 2016-05-17 at 23:30 -0700, Guenter Roeck wrote: > > On Wed, May 18, 2016 at 02:13:30AM +0200, Heinrich Schuchardt wrote: > > > (!count || count < 4) is always true. > > > > Even if count >= 4 ? > > The check for !count is redundant, though.

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

2016-05-18 Thread Johan Hovold
On Mon, May 16, 2016 at 10:50:56AM +0100, Martyn Welch wrote: > On 12/04/16 09:15, Martyn Welch wrote: > > On 12/04/16 09:08, Johan Hovold wrote: > >> On Tue, Apr 12, 2016 at 09:01:52AM +0100, Martyn Welch wrote: > >>> Johan, > >>> > >>> Thanks for reviewing the other patch in this series. I

RE: [PATCH v8 13/14] usb: gadget: udc: adapt to OTG core

2016-05-18 Thread Jun Li
> >> > >> I didn't want to have complex Kconfig so decided to have otg as > >> built-in only. > >> What do you want me to change in existing code? and why? > > > > Remove those stuff which only for pass diff driver config Like every > > controller driver need a duplicated > > > > static struct

Re: UBSAN whinge in ihci-hub.c

2016-05-18 Thread Andrey Ryabinin
2016-05-18 17:40 GMT+03:00 Alan Stern : > All right, I'm getting very tired of all these bug reports. Besides, > Andrey has a point: Unless you're Linus, arguing against the C standard > is futile. (Even though the language dialect used in the kernel is not > standard

[PATCH] usb: echi-hcd: Add register access check in shutdown

2016-05-18 Thread Srinivas Kandagatla
This patch adds a check in ehci_shutdown(), to make sure that the register access is available before accessing registers. The use case is simple, for boards like DB410c where the usb host or device functionality is decided based on the micro-usb cable presence. If the board boots up with

Re: UBSAN whinge in ihci-hub.c

2016-05-18 Thread Alan Stern
On Wed, 18 May 2016, Andrey Ryabinin wrote: > 2016-05-18 13:19 GMT+03:00 Oliver Neukum : > > On Wed, 2016-05-18 at 12:16 +0300, Andrey Ryabinin wrote: > >> 2016-05-18 11:18 GMT+03:00 Oliver Neukum : > >> > On Wed, 2016-05-18 at 10:40 +0300, Andrey Ryabinin

Re: [PATCH] usb: echi-hcd: Add register access check in shutdown

2016-05-18 Thread Alan Stern
On Wed, 18 May 2016, Srinivas Kandagatla wrote: > This patch adds a check in ehci_shutdown(), to make sure > that the register access is available before accessing registers. > > The use case is simple, for boards like DB410c where the usb host > or device functionality is decided based on the

Re: [PATCH] usb: quirks: Add no-lpm quirk for Acer C120 LED Projector

2016-05-18 Thread Alan Stern
On Wed, 18 May 2016, Hans de Goede wrote: > The Acer C120 LED Projector is a USB-3 connected pico projector which > takes both its power and video data from USB-3. > > In combination with some hubs this device does not play well with > lpm, so disable lpm for it. > > Signed-off-by: Hans de

Re: [PATCH] usb: echi-hcd: Add register access check in shutdown

2016-05-18 Thread Alan Stern
On Wed, 18 May 2016, Srinivas Kandagatla wrote: > On 18/05/16 15:56, Alan Stern wrote: > > On Wed, 18 May 2016, Srinivas Kandagatla wrote: > > > >> This patch adds a check in ehci_shutdown(), to make sure > >> that the register access is available before accessing registers. > >> > >> The use

Re: UBSAN whinge in ihci-hub.c

2016-05-18 Thread Alan Stern
On Wed, 18 May 2016, Andrey Ryabinin wrote: > 2016-05-18 17:40 GMT+03:00 Alan Stern : > > > All right, I'm getting very tired of all these bug reports. Besides, > > Andrey has a point: Unless you're Linus, arguing against the C standard > > is futile. (Even though

Re: [PATCH] usb: echi-hcd: Add register access check in shutdown

2016-05-18 Thread Srinivas Kandagatla
On 18/05/16 15:56, Alan Stern wrote: On Wed, 18 May 2016, Srinivas Kandagatla wrote: This patch adds a check in ehci_shutdown(), to make sure that the register access is available before accessing registers. The use case is simple, for boards like DB410c where the usb host or device

Re: [PATCH] usb: echi-hcd: Add register access check in shutdown

2016-05-18 Thread Srinivas Kandagatla
On 18/05/16 17:15, Alan Stern wrote: On Wed, 18 May 2016, Srinivas Kandagatla wrote: On 18/05/16 15:56, Alan Stern wrote: On Wed, 18 May 2016, Srinivas Kandagatla wrote: This patch adds a check in ehci_shutdown(), to make sure that the register access is available before accessing

Re: [PATCHv2 00/15] Get MUSB PM runtime working again

2016-05-18 Thread Bin Liu
Hi, On Tue, May 17, 2016 at 05:05:02PM -0500, Bin Liu wrote: > On Tue, May 17, 2016 at 02:54:04PM -0700, Tony Lindgren wrote: > > * Bin Liu [160517 14:17]: > > > Hi Tony, > > > > > > On Wed, May 11, 2016 at 05:53:01PM -0700, Tony Lindgren wrote: > > > > Hi all, > > > > > > > >

Re: UBSAN whinge in ihci-hub.c

2016-05-18 Thread Andrey Ryabinin
2016-05-18 19:09 GMT+03:00 Alan Stern : > On Wed, 18 May 2016, Andrey Ryabinin wrote: > >> 2016-05-18 17:40 GMT+03:00 Alan Stern : >> >> > All right, I'm getting very tired of all these bug reports. Besides, >> > Andrey has a point: Unless

Re: [PATCH] usb: echi-hcd: Add register access check in shutdown

2016-05-18 Thread Srinivas Kandagatla
On 18/05/16 15:56, Alan Stern wrote: This doesn't seem like the right place. What you really should do is skip calling ehci_silence_controller() if the hardware isn't accessible. That's where the hardware gets touched, not in ehci_shutdown(). Just tried this suggestion, this would not work

Re: [PATCHv2 00/15] Get MUSB PM runtime working again

2016-05-18 Thread Tony Lindgren
* Bin Liu [160517 15:06]: > On Tue, May 17, 2016 at 02:54:04PM -0700, Tony Lindgren wrote: > > > s/pm_runtime_put/pm_runtime_put_sync/ will fix it. I'm wondering why > > it breaks though as dsps glue does not use autosuspend? It could also > > I am not familiar with pm-runtime

Re: [PATCHv2 00/15] Get MUSB PM runtime working again

2016-05-18 Thread Bin Liu
On Wed, May 18, 2016 at 11:07:37AM -0700, Tony Lindgren wrote: > * Bin Liu [160517 15:06]: > > On Tue, May 17, 2016 at 02:54:04PM -0700, Tony Lindgren wrote: > > > > > s/pm_runtime_put/pm_runtime_put_sync/ will fix it. I'm wondering why > > > it breaks though as dsps glue does not

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

2016-05-18 Thread John Youn
On 5/18/2016 12:34 AM, Felipe Balbi wrote: > > Hi John, > > 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

Re: [PATCHv2 00/15] Get MUSB PM runtime working again

2016-05-18 Thread Tony Lindgren
* Bin Liu [160518 10:37]: > I think I found the problem. Before having the offending patch, > musb_gadget_pullup() got called by musb_gadget_start(), then pm_suspend > immediately (~2us) happens, and musb_save_context() backs up DEVCTL register > which has session bit set. > > But