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

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

Re: [PATCH] usb: xhci-mtk: fixup mouse wakeup failure during system suspend

2016-05-04 Thread Felipe Balbi
Hi, chunfeng yun writes: > On Tue, 2016-05-03 at 12:33 +0300, Felipe Balbi wrote: >> Hi, >> >> chunfeng yun writes: >> >> chunfeng yun writes: >> >> > On Thu, 2016-04-21 at 10:04 +0800, Chunfeng Yun wrote: >> >> >> C

Re: [PATCH] usb: misc: usbtest: fix pattern tests for scatterlists.

2016-05-04 Thread Felipe Balbi
Hi, Alan Stern writes: >> Alan Stern writes: >> > On Mon, 2 May 2016, Mathias Nyman wrote: >> > >> >> The current implemenentation restart the sent pattern for each entry in >> >> the sg list. The receiving end expects a continuous pattern, and test >> >> will fail unless scatterilst entries ha

Re: [PATCH net-next 4/5] treewide: replace dev->trans_start update with helper

2016-05-04 Thread Felipe Balbi
t; Cc: linux-blueto...@vger.kernel.org > Signed-off-by: Florian Westphal > --- for u_ether.c: Acked-by: Felipe Balbi > diff --git a/drivers/usb/gadget/function/u_ether.c > b/drivers/usb/gadget/function/u_ether.c > index 637809e..a3f7e7c 100644 > --- a/drivers/usb/gadget/fun

Re: [PATCH] usb: gadget: f_fs: Fix kernel panic for SuperSpeed

2016-05-04 Thread Felipe Balbi
Hi, Jim Lin writes: >>> In f_fs.c >>> " >>> static int __ffs_data_do_os_desc(enum ffs_os_desc_type type, >>>struct usb_os_desc_header *h, void *data, >>>unsigned len, void *priv) >>> { >>> struct ffs_data *ffs = priv; >>> u8 length; >>> >>>

Re: [PATCH] usb: dwc3: usb/dwc3: fake dissconnect event when turn off pullup

2016-05-04 Thread Felipe Balbi
Hi, John Youn writes: >> John Youn writes: "Du, Changbin" writes: > Hi, Balbi, > > The step to reproduce this issue is: > 1) connect device to a host and wait its enumeration. > 2) trigger software disconnect by calling function > usb_gadget_disconnect(), which

Re: [PATCH] usb: xhci-mtk: fixup mouse wakeup failure during system suspend

2016-05-04 Thread Felipe Balbi
Hi, chunfeng yun writes: >> chunfeng yun writes: >> > On Tue, 2016-05-03 at 12:33 +0300, Felipe Balbi wrote: >> >> Hi, >> >> >> >> chunfeng yun writes: >> >> >> chunfeng yun writes: >> >> >> > On Thu,

Re: [PATCH] usb: gadget: f_fs: Fix kernel panic for SuperSpeed

2016-05-05 Thread Felipe Balbi
Hi Jim, Jim Lin writes: > On 2016年05月04日 18:37, Felipe Balbi wrote: >> * PGP Signed by an unknown key >> >> >> Hi, >> >> Jim Lin writes: >> >> >> >>>>> In f_fs.c >>>>> " >>>>> static i

Re: [PATCH 02/10] usb: musb: Fix idling after host mode by increasing autosuspend delay

2016-05-05 Thread Felipe Balbi
Hi, Bin Liu writes: >> Does the current 200 ms autosuspend timeout relate to anything real >> other than what I found out with my measurements? > > Not sure, I didn't checkk where the 200ms comes from. It was an arbitrary number from when runtime PM was first added by Hema. I don't think it has

Re: [PATCH 0/3] usb: USB Type-C Class and driver for UCSI

2016-05-05 Thread Felipe Balbi
Hi Guenter, Guenter Roeck writes: > On Tue, Feb 09, 2016 at 07:01:20PM +0200, Heikki Krogerus wrote: >> Hi, >> >> The OS, or more precisely the user space, needs to be able to control >> a few things regarding USB Type-C ports. The first thing that must be >> allowed to be controlled is the dat

Re: [PATCH] usb: misc: usbtest: fix pattern tests for scatterlists.

2016-05-05 Thread Felipe Balbi
Hi, Alan Stern writes: > On Wed, 4 May 2016, Felipe Balbi wrote: > >> > multiple of 512 bytes and the maxpacket size is 1024. Then you either >> >> that's not common case for testusb. One of the test cases (see below) >> exercises exactly small sg ent

Re: [PATCH] usb: gadget: Fix binding to UDC via configfs interface

2016-05-06 Thread Felipe Balbi
Hi, Krzysztof Opasiak writes: > By default user could store only valid UDC name in configfs UDC > attr by doing: > > echo $UDC_NAME > UDC > > Commit (855ed04 "usb: gadget: udc-core: independent registration of > gadgets and gadget drivers") broke this behavior and allowed to store > any arbitrar

Re: [PATCH] usb: dwc3: usb/dwc3: fake dissconnect event when turn off pullup

2016-05-06 Thread Felipe Balbi
Hi, Peter Chen writes: >> "Du, Changbin" writes: >> > Hi, Balbi, >> > >> > The step to reproduce this issue is: >> > 1) connect device to a host and wait its enumeration. >> > 2) trigger software disconnect by calling function >> > usb_gadget_disconnect(), which finally call >> >dwc3_ga

Re: [PATCH] usb: dwc3: usb/dwc3: fake dissconnect event when turn off pullup

2016-05-06 Thread Felipe Balbi
Hi, Peter Chen writes: >> Peter Chen writes: >> >> "Du, Changbin" writes: >> >> > Hi, Balbi, >> >> > >> >> > The step to reproduce this issue is: >> >> > 1) connect device to a host and wait its enumeration. >> >> > 2) trigger software disconnect by calling function >> >> > usb_gadget_disc

Re: [PATCH v3] usb: host: xhci-rcar: Avoid long wait in xhci_reset()

2016-05-06 Thread Felipe Balbi
ONFIG_USB_XHCI_RCAR. > > Fixes: 4ac8918f3a7 (usb: host: xhci-plat: add support for the R-Car H2 and M2 > xHCI controllers) > Cc: # v3.17+ > > Signed-off-by: Yoshihiro Shimoda looks good to me, thanks :) Reviewed-by: Felipe Balbi > --- > Changes from v2: > -

Re: [PATCH] usb: dwc3: usb/dwc3: fake dissconnect event when turn off pullup

2016-05-06 Thread Felipe Balbi
Hi, John Youn writes: > As you mentioned this is handled in the soft_disconnect sysfs. Why > shouldn't usb_gadget_disconnect() do the same thing, if not the gadget because there might be cases where we don't need/want the gadget to know about this disconnect. >>> >>>

Re: [PATCH 1/1] usb: net2272: avoid shifting 0

2016-05-09 Thread Felipe Balbi
Heinrich Schuchardt writes: > Remove redundant code. > Or'ing with a shifted value of zero is a NOP. > > Signed-off-by: Heinrich Schuchardt it sure is and the compiler is getting rid of those. They are there as means of documentation only ;-) I really have no strong feelings about this patch,

Re: [PATCH] usb: misc: usbtest: fix pattern tests for scatterlists.

2016-05-09 Thread Felipe Balbi
Hi, Alan Stern writes: > On Fri, 6 May 2016, Felipe Balbi wrote: > >> >> that's not a good idea, IMO. HCD drivers should be robust enough in >> >> these situations. >> > >> > Why? Just so that hcd-tests.sh can complete with no errors

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

2016-05-09 Thread Felipe Balbi
Hi, Arnd Bergmann writes: > On Monday 09 May 2016 10:23:22 Benjamin Herrenschmidt wrote: >> On Sun, 2016-05-08 at 13:44 +0200, Christian Lamparter wrote: >> > On Sunday, May 08, 2016 08:40:55 PM Benjamin Herrenschmidt wrote: >> > > >> > > On Sun, 2016-05-08 at 00:54 +0200, Christian Lamparter v

Re: [PATCH] usb: dwc3: add DWC3_GUCTL1 reg for debug

2016-05-09 Thread Felipe Balbi
William Wu writes: > Signed-off-by: William Wu no changelog = no commit, sorry. Why do you want to dump GUCTL1? > --- > drivers/usb/dwc3/core.h| 1 + > drivers/usb/dwc3/debugfs.c | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h >

Re: [PATCH 3/4] usb: dwc3: make usb2 phy interface configurable in DT

2016-05-09 Thread Felipe Balbi
Hi, William Wu writes: > Add snps,phyif_utmi_16_bits devicetree property. USB2 phy this needs a quirk_ prefix... > interface is hardware property, and it's platform dependent, > so we need to configure it in devicetree to set the core to > support a UTMI+ PHY with an 8- or 16-bit interface. >

Re: [PATCH 3/4] usb: dwc3: make usb2 phy interface configurable in DT

2016-05-09 Thread Felipe Balbi
Hi William, William Wu writes: > On 05/09/2016 08:18 PM, Felipe Balbi wrote: >> Hi, >> >> William Wu writes: >>> Add snps,phyif_utmi_16_bits devicetree property. USB2 phy >> this needs a quirk_ prefix... > Yes, maybe a quirk is more proper. As

Re: [PATCH] usb: dwc3: add DWC3_GUCTL1 reg for debug

2016-05-09 Thread Felipe Balbi
William Wu writes: > On 05/09/2016 08:10 PM, Felipe Balbi wrote: >> William Wu writes: > Thanks Felipe Balbi and Greg KH. I'm really sorry that I forgot to > add changelog. >>> Signed-off-by: William Wu >> no changelog = no commit, sorry. Why do you

Re: [PATCH 1/4] usb: dwc3: of-simple: add compatible for rockchip

2016-05-10 Thread Felipe Balbi
Hi, Doug Anderson writes: > William, > > On Mon, May 9, 2016 at 4:46 AM, William Wu wrote: >> Signed-off-by: William Wu >> --- >> drivers/usb/dwc3/dwc3-of-simple.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/usb/dwc3/dwc3-of-simple.c >> b/drivers/usb/dwc3/dwc3-of-simp

Re: [PATCH 1/4] usb: dwc3: of-simple: add compatible for rockchip

2016-05-10 Thread Felipe Balbi
Hi, Brian Norris writes: > Hi William, > > Did you leave off linux-rockc...@lists.infradead.org intentionally? IMO, > it's nice to have that list in CC, so interested parties can follow your > work, even if they aren't as fortunate as me to have been CC'd on your > patch directly. > > On Mon, Ma

Re: [PATCH 1/4] usb: dwc3: of-simple: add compatible for rockchip

2016-05-10 Thread Felipe Balbi
Hi William, William Wu writes: > Dear Felipe & Doug, > Thanks for your proposal. It's a good idea to sort the list. > I'll fix it next patch version. cool, thanks. ps: top-posting is frowned upon here. Please avoid it ;-) -- balbi signature.asc Description: PGP signature

Re: [PATCH v7 03/14] usb: hcd.h: Add OTG to HCD interface

2016-05-10 Thread Felipe Balbi
Hi, Roger Quadros writes: > On 10/05/16 06:14, Peter Chen wrote: >> On Mon, May 09, 2016 at 12:45:38PM +0300, Roger Quadros wrote: >>> On 06/05/16 12:41, Peter Chen wrote: On Mon, May 02, 2016 at 03:18:46PM +0300, Roger Quadros wrote: > The OTG core will use struct otg_hcd_ops to interf

Re: [PATCH v7 4/5] usb: dwc3: omap: Pass VBUS and ID events transparently

2016-05-10 Thread Felipe Balbi
Hi, Roger Quadros writes: > 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 p

Re: [PATCH v7 3/5] usb: dwc3: omap: Don't set POWERPRESENT

2016-05-10 Thread Felipe Balbi
Hi, Roger Quadros writes: > 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

Re: [PATCH v7 1/5] usb: dwc3: omap: use request_threaded_irq()

2016-05-10 Thread Felipe Balbi
Hi, Roger Quadros writes: > 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 w

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

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

Re: [PATCH v7 3/5] usb: dwc3: omap: Don't set POWERPRESENT

2016-05-10 Thread Felipe Balbi
Hi, Roger Quadros writes: > On 10/05/16 12:54, Felipe Balbi wrote: >> >> Hi, >> >> Roger Quadros writes: >>> TRM [1] recommends that POWERPRESENT bit must not be >>> set and left at it's default value of 0. >>> >>> [1] OMAP

Re: [PATCH v7 4/5] usb: dwc3: omap: Pass VBUS and ID events transparently

2016-05-10 Thread Felipe Balbi
Hi, Roger Quadros writes: > On 10/05/16 12:55, Felipe Balbi wrote: >> >> Hi, >> >> Roger Quadros writes: >>> Don't make any decisions regarding VBUS session based on ID >>> status. That is best left to the OTG core. >>> >&g

Re: [PATCH v7 1/5] usb: dwc3: omap: use request_threaded_irq()

2016-05-10 Thread Felipe Balbi
Hi, Roger Quadros writes: >>> @@ -497,8 +503,8 @@ static int dwc3_omap_probe(struct platform_device *pdev) >>> /* check the DMA Status */ >>> reg = dwc3_omap_readl(omap->base, USBOTGSS_SYSCONFIG); >>> >>> - ret = devm_request_irq(dev, omap->irq, dwc3_omap_interrupt, 0, >>> -

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

2016-05-10 Thread Felipe Balbi
Hi, Roger Quadros writes: >>> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h >>> index 186a886..2e20892 100644 >>> --- a/drivers/usb/dwc3/core.h >>> +++ b/drivers/usb/dwc3/core.h >>> @@ -716,6 +716,8 @@ struct dwc3_scratchpad_array { >>> * @maximum_speed: maximum speed requeste

Re: [PATCH v7 4/5] usb: dwc3: omap: Pass VBUS and ID events transparently

2016-05-10 Thread Felipe Balbi
Hi, Roger Quadros writes: Roger Quadros writes: > 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

Re: [PATCH v7 3/5] usb: dwc3: omap: Don't set POWERPRESENT

2016-05-10 Thread Felipe Balbi
Hi, Roger Quadros writes: > On 10/05/16 13:04, Felipe Balbi wrote: >> >> Hi, >> >> Roger Quadros writes: >>> On 10/05/16 12:54, Felipe Balbi wrote: >>>> >>>> Hi, >>>> >>>> Roger Quadros writes: >>&

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

2016-05-10 Thread Felipe Balbi
Hi, Roger Quadros writes: >> Roger Quadros writes: > diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h > index 186a886..2e20892 100644 > --- a/drivers/usb/dwc3/core.h > +++ b/drivers/usb/dwc3/core.h > @@ -716,6 +716,8 @@ struct dwc3_scratchpad_array { > *

Re: [PATCH v7 1/5] usb: dwc3: omap: use request_threaded_irq()

2016-05-11 Thread Felipe Balbi
Hi, Roger Quadros writes: >> Roger Quadros writes: > @@ -497,8 +503,8 @@ static int dwc3_omap_probe(struct platform_device > *pdev) > /* check the DMA Status */ > reg = dwc3_omap_readl(omap->base, USBOTGSS_SYSCONFIG); > > - ret = devm_request_irq(dev, omap->irq, d

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

2016-05-11 Thread Felipe Balbi
Hi, changbin...@intel.com writes: > From: "Du, Changbin" > > Since the buffer size for req is rounded up to maxpacketsize, > then we may end up with more data then user space has space > for. only for OUT direction with the controller you're using ;-) > If it happen, we can keep the excess dat

Re: [PATCH v7 1/5] usb: dwc3: omap: use request_threaded_irq()

2016-05-11 Thread Felipe Balbi
Hi, Roger Quadros writes: static irqreturn_t dwc3_omap_threaded_interrupt(int irq, void *_omap) { struct dwc3_omap *omap = _omap; u32 reg; spin_lock(&omap->lock); >>> >>> Do we really need a spin_lock for the dwc3-omap driver? >>> Currently w

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

2016-05-11 Thread Felipe Balbi
Hi, "Du, Changbin" writes: >> > If it happen, we can keep the excess data for next i/o, or >> > report an error. But we cannot silently drop data, because >> > USB layer should ensure the data integrality it has transferred, >> > otherwise applications may get corrupt data if it doesn't >> > det

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

2016-05-12 Thread Felipe Balbi
Hi, "Du, Changbin" writes: > Hi, > >> >> and when has this actually happened ? Host should not send more data in >> >> this case, if it does, it's an error on the host side. Also, returning >> >> -EOVERFLOW is not exactly correct here, because you'd violate POSIX >> >> specification of read(), r

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

2016-05-12 Thread Felipe Balbi
Hi, "Du, Changbin" writes: >> >> > The problem is device side app sometimes received incorrect data >> caused >> >> > by the dropping. Most times the error can be detected by APP itself, but >> >> >> >> why ? app did e.g. read(5), that caused driver to queue a usb_request >> >> with length set t

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

2016-05-12 Thread Felipe Balbi
Hi again, Felipe Balbi writes: > @@ -811,7 +815,12 @@ static ssize_t ffs_epfile_io(struct file *file, struct > ffs_io_data *io_data) >*/ > ret = interrupted ? -EINTR : ep->status; > if (io_data->read && ret >

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

2016-05-12 Thread Felipe Balbi
Hi, "Du, Changbin" writes: >> >> > These all can lead host send more than device wanted bytes. For sure >> >> > it wrong at host side, but device side don't know. >> >> >> >> but none of this means we have a bug at device side. In fact, by >> >> allowing these extra bytes to reach userspace, we

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

2016-05-12 Thread Felipe Balbi
Hi, "Du, Changbin" writes: >> >> > These all can lead host send more than device wanted bytes. For sure >> >> > it wrong at host side, but device side don't know. >> >> >> >> but none of this means we have a bug at device side. In fact, by >> >> allowing these extra bytes to reach userspace, we

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

2016-05-12 Thread Felipe Balbi
Hi, "Du, Changbin" writes: >> right, and that was my point: if we copy more to userspace, then we have >> a real big problem. >> > Yes, we drop the data because we userspace buffer is not enough this time. > The problem here is that really can we just drop it silently? Maybe not. Yeah, it prob

Re: [PATCH] usb: dwc2: fix regression on big-endian PowerPC/ARM systems

2016-05-12 Thread Felipe Balbi
Hi, Arnd Bergmann writes: > A patch that went into Linux-4.4 to fix big-endian mode on a Lantiq > MIPS system unfortunately broke big-endian operation on PowerPC > APM82181 as reported by Christian Lamparter, and likely other > systems. > > It actually introduced multiple issues: > > - it broke

Re: [PATCH] usb: dwc2: fix regression on big-endian PowerPC/ARM systems

2016-05-12 Thread Felipe Balbi
Hi, (Arnd, you didn't Cc dwc2's maintainer. I'm also not part of TI anymore) Arnd Bergmann writes: > On Thursday 12 May 2016 14:25:49 Felipe Balbi wrote: >> > { >> > u32 value = __raw_readl(addr); >> > >> > - /* In

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

2016-05-12 Thread Felipe Balbi
Hi, "Du, Changbin" writes: >> "Du, Changbin" writes: >> >> right, and that was my point: if we copy more to userspace, then we have >> >> a real big problem. >> >> >> > Yes, we drop the data because we userspace buffer is not enough this time. >> > The problem here is that really can we just dr

Re: [PATCH v2 0/5] support rockchip dwc3 driver

2016-05-13 Thread Felipe Balbi
Hi, William Wu writes: > This series add support for rockchip dwc3 driver, > and add additional optional properties for specific > platforms (e.g., rockchip platform). > > William Wu (5): > usb: dwc3: of-simple: add compatible for rockchip > usb: dwc3: add dis_u2_freeclk_exists_quirk > usb

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

2016-05-13 Thread Felipe Balbi
Hi, Baolin Wang writes: > Currently on some platforms, the gadget device can be power off to > save power when the Vbus is off, which means no cable plugging in > now. In this situation we should defer starting the gadget until the > gadget device is power on by connecting host. okay, you need

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

2016-05-13 Thread Felipe Balbi
Hi, Baolin Wang writes: >>> diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h >>> index 6254b2f..dada5c6 100644 >>> --- a/drivers/usb/dwc3/core.h >>> +++ b/drivers/usb/dwc3/core.h >>> @@ -734,6 +734,9 @@ struct dwc3_scratchpad_array { >>> * 1 - -3.5dB de-emphasis >>> *

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

2016-05-13 Thread Felipe Balbi
Hi, Baolin Wang writes: why does it need restart? Why is dwc3 powered off? Who powers it off? >>> >>> Because when the dwc3 Vbus is off (no cable pluging in now), >>> especially for some mobile device, the system need to power off the >>> dwc3 to save power in this situation. >> >> but dwc3

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

2016-05-16 Thread Felipe Balbi
Hi, Alan Stern writes: > On Fri, 13 May 2016, Felipe Balbi wrote: > >> We deliver to userspace the part userspace requested, right? So that's >> okay. The USB details WRT e.g. babble or host trying to send more data >> than expected, needs to be handled within the

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

2016-05-16 Thread Felipe Balbi
t ask for all the >>> data that he expected. Maybe the user wanted to retrieve the full >>> set of data using two read() system calls. > > On Mon, May 16 2016, Felipe Balbi wrote: >> right, but that just means we need to buffer the data instead of bailing >> out of

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

2016-05-17 Thread Felipe Balbi
Hi Baolin Wang writes: > Hi Felipe, > > On 13 May 2016 at 20:46, Felipe Balbi wrote: >> >> Hi, >> >> Baolin Wang writes: >>>>>> why does it need restart? Why is dwc3 powered off? Who powers it off? >>>>> >>>>>

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

2016-05-17 Thread Felipe Balbi
Hi, 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 continue to optimize the >>> power management things. Thanks. >> >> I have it half-way done

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 IN/OUT interrupts. > > Th

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

[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 changed, 4 ins

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

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

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

[PATCH 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 --- drivers/usb/dwc3/gadg

[PATCH 02/22] usb: dwc3: gadget: fix gadget suspend/resume

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

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

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

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

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

[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 deletions(-) diff --git a/drivers/usb

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

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

[PATCH 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 file changed

[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 --- drivers/usb/dwc3/core.c

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

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

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

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

[PATCH 00/22] usb: dwc3 / f_mass_storage: misc changes

2016-05-18 Thread Felipe Balbi
v4.8 and I'll keep them soaking on linux-next for as long as I can (I want these patches soaking for at least 5 weeks there). cheers Felipe Balbi (22): usb: dwc3: gadget: re-factor ->udc_start and ->udc_stop usb: dwc3: gadget: fix gadget suspend/resume usb: dwc3: core: get rid of

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

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

[PATCH 13/22] usb: dwc3: gadget: pass dep as argument to endpoint command

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

[PATCH 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 --- drivers/usb/dwc3/core.h | 12 +++ drivers/usb/dwc3/gadget.c

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

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

[PATCH 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 index a590cd225bb7..245f4ff

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

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 continue to optimize the >> power management

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 patch at this point. It

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 (pm_runtime_suspended(dwc->dev)) >>> +

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
nal commit and making sure that we check for isochronous endpoints. Fixes: f3af36511e60 ("usb: dwc3: gadget: always enable IOC on bulk/interrupt transfers") Cc: Signed-off-by: Konrad Leszczynski Signed-off-by: Rafal Redzimski Signed-off-by: Felipe Balbi --- drivers/u

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

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

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

2016-05-19 Thread Felipe Balbi
Hi, Paul Zimmerman writes: > 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, inste

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

2016-05-19 Thread Felipe Balbi
Hi, John Youn writes: >> @@ -1589,6 +1578,46 @@ static void dwc3_gadget_disable_irq(struct dwc3 *dwc) >> static irqreturn_t dwc3_interrupt(int irq, void *_dwc); >> static irqreturn_t dwc3_thread_interrupt(int irq, void *_dwc); >> >> +/** >> + * dwc3_gadget_setup_nump - Calculate and initiali

Re: [PATCH 1/2] usb: dwc3: gadget: Simplify skipping of link TRBs

2016-05-19 Thread Felipe Balbi
Hi, John Youn writes: > Make the skipping of the link TRBS build-in to the increment and > decrement operations. This simplifies the code wherever we increment and > decrement and ensures that we never end up pointing to a link trb. > > Signed-off-by: John Youn I had this in my TODO for today

Re: [PATCH 2/2] usb: dwc3: gadget: Various fixes to trbs_left calculation

2016-05-19 Thread Felipe Balbi
Hi, John Youn writes: > This patch fixes up some issues related to the trb_left calculation. > > This calculation sometimes included the link trb slot in the trbs_left > and sometimes didn't. good catch. But this patch seems like it can be broken into smaller pieces. See below > In the case wh

Re: xhci DWC3 flavor problem

2016-05-19 Thread Felipe Balbi
Hi João, Adding Mathias, who's xHCI's maintainer Joao Pinto writes: > Hi Felipe, > > I am trying to bring up a DWC USB 3.0 Host with linux (v4.6-rc5) > running in a ARM64 development board. Just to be clear, is this Juno with dwc3 in FPGA or do you have dwc3 in ASIC? > I have implemented the

Re: xhci DWC3 flavor problem

2016-05-19 Thread Felipe Balbi
Hi, Joao Pinto writes: > Hi Felipe and Mathias, > > Sending kernel log with extra xhci messages in attachment! > Thanks you for the help! yeah, no problems. So here's the interesting part: *INSERTING PEN DRIVE # xhci-hcd xhci-hcd.0.auto: Port Status Chang

Re: xhci DWC3 flavor problem

2016-05-19 Thread Felipe Balbi
Hi, Joao Pinto writes: > Hi Felipe, > > On 5/19/2016 11:32 AM, Felipe Balbi wrote: >> >> Hi, >> >> Joao Pinto writes: >>> Hi Felipe and Mathias, >>> >>> Sending kernel log with extra xhci messages in attachment! >>> Thanks

Re: [PATCH 2/2] usb: dwc3: gadget: Various fixes to trbs_left calculation

2016-05-20 Thread Felipe Balbi
Hi, John Youn writes: > On 5/19/2016 12:51 AM, Felipe Balbi wrote: >> >> Hi, >> >> John Youn writes: >>> This patch fixes up some issues related to the trb_left calculation. >>> >>> This calculation sometimes included the link trb slot

Re: composite gadget with _real_ USB device

2016-05-20 Thread Felipe Balbi
Hi, Shea Ako writes: > I’ve been learning about and playing with configfs and functionfs to > create composite user space USB gadgets. My objective is to create a > composite USB gadget that incorporates a custom functionfs function of > my own creation along with some _real_ USB devices connect

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

2016-05-22 Thread Felipe Balbi
It's unlikely that we will ever know the avg so instead of assuming it'll be something really large, we will calculate the avg as we go as mentioned in XHCI specification section 4.14.1.1. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-m

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

2016-05-22 Thread Felipe Balbi
when getting endpoint type a switch statement looks better than a series of if () branches. There are no functional changes with this patch, cleanup only. Signed-off-by: Felipe Balbi --- drivers/usb/host/xhci-mem.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a

  1   2   3   4   5   6   7   8   9   10   >