Re: [PATCH 1/3] usb: dwc3: gadget: Prevent losing events in event cache

2017-04-10 Thread Janusz Dziedzic
On 10 April 2017 at 20:43, John Youn wrote: > On 04/08/2017 12:38 PM, Janusz Dziedzic wrote: >> 2017-04-08 1:57 GMT+02:00 Thinh Nguyen : >>> The dwc3 driver can overwite its previous events if its top half IRQ >>> handler gets invoked again before processing the even

Re: [PATCH 3/3] usb: dwc3: ep0: improve handling of unaligned OUT requests

2017-04-10 Thread Janusz Dziedzic
On 7 April 2017 at 13:36, Felipe Balbi wrote: > Just like we did for all other endpoint types, let's rely on a chained > TRB pointing to ep0_bounce_addr in order to align transfer size. This > will make the code simpler. > > Signed-off-by: Felipe Balbi > --- > drivers/usb/dwc3/core.h | 6 +---

Re: [PATCH 1/3] usb: dwc3: gadget: Prevent losing events in event cache

2017-04-08 Thread Janusz Dziedzic
2017-04-08 1:57 GMT+02:00 Thinh Nguyen : > The dwc3 driver can overwite its previous events if its top half IRQ > handler gets invoked again before processing the events in the cache. We > see this as a hang in the file transfer and the host will attempt to > reset the device. This shouldn't be pos

Re: usb: host: xhci: stalled endpoint ring not cleared on empty td_list

2017-03-30 Thread Janusz Dziedzic
On 30 March 2017 at 11:23, Greg KH wrote: > On Thu, Mar 30, 2017 at 11:11:34AM +0200, Janusz Dziedzic wrote: >> On 30 March 2017 at 10:53, Greg KH wrote: >> > On Thu, Mar 30, 2017 at 10:29:41AM +0200, Christian Gromm wrote: >> >> >> >> >&g

Re: usb: host: xhci: stalled endpoint ring not cleared on empty td_list

2017-03-30 Thread Janusz Dziedzic
On 30 March 2017 at 10:53, Greg KH wrote: > On Thu, Mar 30, 2017 at 10:29:41AM +0200, Christian Gromm wrote: >> >> >> On 03/27/2017 11:31 AM, Felipe Balbi wrote: >> > >> > Hi, >> > >> > Christian Gromm writes: >> > > we observe an issue with a td_list running empty and an >> > > endpoint being st

Re: [PATCH] usb: dwc2: pci: Fix error handling in dwc2_pci_probe

2017-02-17 Thread Janusz Dziedzic
On 17 February 2017 at 14:01, Vardan Mikayelyan wrote: > Move usb_phy_generic_register() function call to the top, to simplify > error handling. > > Replace kzalloc() with devm_kzalloc(). > > After platform_device_add(), if we error out, we must do > platform_device_unregister(), which also does t

[PATCH] Revert "usb: gadget: f_fs: Fix ExtCompat descriptor validation"

2017-02-16 Thread Janusz Dziedzic
This reverts commit ac670a3a650b899fc020b81f63e810d06015b865. This introduce bug we already fixed in commit 53642399aa71 ("usb: gadget: f_fs: Fix wrong check on reserved1 wof OS_DESC_EXT_COMPAT") Next FFS (adb) SS enumeration fail with Windows OS. Signed-off-by: Janusz Dziedzic --

Re: [PATCH v2 28/37] usb: host: xhci: combine event TRB completion debugging messages

2017-01-24 Thread Janusz Dziedzic
On 23 January 2017 at 13:20, Mathias Nyman wrote: > From: Felipe Balbi > > If we just provide a helper to convert completion code to string, we can > combine all debugging messages into a single print. > > [keep the old debug messages, for warn and grep -Mathias] > Signed-off-by: Felipe Balbi >

Re: [PATCH] usb: dwc3: gadget: Avoid race between dwc3 interrupt handler and irq thread handler

2016-12-28 Thread Janusz Dziedzic
ts are already disabled. > BTW, We don't use spin_lock in top half handler. Maybe we should/can switch all spin_lock_irqsave() to simple spin_lock() in the thread/callbacks? Or there is a reason to use irqsave() version? BR Janusz > -- > balbi -- Janusz Dziedzic -- To unsub

Re: [PATCH] usb: dwc3: gadget: Avoid race between dwc3 interrupt handler and irq thread handler

2016-12-28 Thread Janusz Dziedzic
2016-12-27 13:16 GMT+01:00 Baolin Wang : > Hi, > > On 27 December 2016 at 19:11, Felipe Balbi wrote: >> >> Hi, >> >> Baolin Wang writes: >>> Hi, >>> >>> On 27 December 2016 at 18:52, Janusz Dziedzic >>> wrote: >>

Re: [PATCH] usb: dwc3: gadget: Avoid race between dwc3 interrupt handler and irq thread handler

2016-12-27 Thread Janusz Dziedzic
mp;dwc->lock); > > return IRQ_WAKE_THREAD; > } > -- > 1.7.9.5 > > -- > 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.ker

[PATCH] usb: dwc3: skip interrupt when ep disabled

2016-12-08 Thread Janusz Dziedzic
In case EP disabled pass only EPCPLT command to be handled. In other case we could hit Bug like below. BUG: unable to handle kernel NULL pointer dereference at 0003 IP: [] dwc3_thread_interrupt+0x11c8/0x1790 while dep->endpoint.desc is NULL. Signed-off-by: Janusz Dzied

Re: [PATCH 3/4] usb: dwc3: gadget: use evt->cache for processing events

2016-11-15 Thread Janusz Dziedzic
On 15 November 2016 at 12:23, Felipe Balbi wrote: > From: John Youn > > Let's start copying events from evt->buf to > evt->cache and use evt->cache for processing events. > > A follow-up patch will be added to clear events in > the top-half handler in order to bring IRQ line low > as soon as poss

Re: [PATCH v2 3/5] usb: dwc3: gadget: Write the event count in interrupt

2016-11-09 Thread Janusz Dziedzic
On 9 November 2016 at 09:05, Felipe Balbi wrote: > > Hi, > > John Youn writes: >>> + dwc3_writel(dwc->regs, DWC3_GEVNTCOUNT(0), count); >>> + > After that evt->buf[lpos, lpos + count] seems goes back to HW, so > thread should not rely on this? > > Or I miss something

[PATCH 5/5] usb: dwc3: warn on once when no trbs

2016-11-09 Thread Janusz Dziedzic
Seems last time we hit few issues where we get trb_left = 0, mainly because of HWO bit still set in previous TRB. Add warn on once to catch/fix such problems much faster. Signed-off-by: Janusz Dziedzic --- drivers/usb/dwc3/gadget.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH 1/5] usb: dwc3: decrement queued_requests

2016-11-09 Thread Janusz Dziedzic
In case we will fail to STARTTRANSFER we should also decrement queued_requests. Signed-off-by: Janusz Dziedzic --- drivers/usb/dwc3/gadget.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index a9c1d75..840e312 100644 --- a/drivers/usb

[PATCH 2/5] usb: dwc3: clean TRB if STARTTRANSFER fail

2016-11-09 Thread Janusz Dziedzic
0 No way to send more data. Signed-off-by: Janusz Dziedzic --- drivers/usb/dwc3/gadget.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 840e312..19bea3b 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -108

[PATCH 3/5] usb: dwc3: fix post-increment

2016-11-09 Thread Janusz Dziedzic
Use pre-increment and set -ETIMEDOUT correctly. Signed-off-by: Janusz Dziedzic --- 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 19bea3b..0cd98c0 100644 --- a/drivers/usb/dwc3/gadget.c

[PATCH 4/5] usb: dwc3: isoc clean DWC3_EP_PENDING_REQUEST flag

2016-11-09 Thread Janusz Dziedzic
After we kick_transfer we should clean DWC3_EP_PENDING_REQUEST endpoint flag. Signed-off-by: Janusz Dziedzic --- drivers/usb/dwc3/gadget.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 0cd98c0..e40d58e 100644 --- a/drivers/usb

Re: [PATCH v2 3/5] usb: dwc3: gadget: Write the event count in interrupt

2016-11-04 Thread Janusz Dziedzic
On 4 November 2016 at 07:41, Janusz Dziedzic wrote: > On 4 November 2016 at 02:31, John Youn wrote: >> >> Since we are saving the event count and handling the events in the >> threaded interrupt handler, we can write and clear out the eventcount in >> the ha

Re: [PATCH v2 3/5] usb: dwc3: gadget: Write the event count in interrupt

2016-11-03 Thread Janusz Dziedzic
On 4 November 2016 at 02:31, John Youn wrote: > > Since we are saving the event count and handling the events in the > threaded interrupt handler, we can write and clear out the eventcount in > the hard interrupt handler itself. > > This behavior will be required for IP 3.00a cores that need to us

[PATCH] usb: gadget: f_hid add super speed support

2016-11-03 Thread Janusz Dziedzic
Add super speed descriptors to f_hid. Signed-off-by: Janusz Dziedzic --- drivers/usb/gadget/function/f_hid.c | 67 - 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c index

Re: [RESEND PATCH v3 1/2] usb: dwc3: gadget: Add disconnect checking when changing function dynamically

2016-10-13 Thread Janusz Dziedzic
On 13 October 2016 at 12:41, Baolin Wang wrote: > On 13 October 2016 at 17:49, Felipe Balbi wrote: >> >> Hi, >> >> Baolin Wang writes: > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > index 1783406..ca2ae5b 100644 > --- a/drivers/usb/dwc3/gadget.c >>

Re: [RESEND PATCH v3 1/2] usb: dwc3: gadget: Add disconnect checking when changing function dynamically

2016-10-13 Thread Janusz Dziedzic
On 13 October 2016 at 10:21, Baolin Wang wrote: > Hi, > > On 13 October 2016 at 16:16, Janusz Dziedzic > wrote: >> On 13 October 2016 at 09:37, Baolin Wang wrote: >>> Hi, >>> >>> On 13 October 2016 at 15:06, Felipe Balbi wrote: >>>>

Re: [RESEND PATCH v3 1/2] usb: dwc3: gadget: Add disconnect checking when changing function dynamically

2016-10-13 Thread Janusz Dziedzic
On 13 October 2016 at 09:37, Baolin Wang wrote: > Hi, > > On 13 October 2016 at 15:06, Felipe Balbi wrote: >> >> Hi, >> >> Baolin Wang writes: >>> When system has stpped the gadget, we should avoid queuing any requests >> >> queueing is *not* a problem. Starting is. In fact, that's what your >>

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

2016-05-27 Thread Janusz Dziedzic
On 19 May 2016 at 09:08, Felipe Balbi wrote: > > Hi, > > Paul Zimmerman writes: >> Felipe Balbi writes: >> >>> If we're going to issue a Update Transfer command, >>> let's clear LST bit from previous TRB. This will let >>> us continue processing TRBs and convert previous IRQ >>> into XferInProgr