Re: [PATCH] usb: core: add usb3 lpm sysfs

2015-04-30 Thread Zhuang Jin Can
On Wed, Apr 29, 2015 at 09:57:33PM +0200, Greg KH wrote: > On Thu, Apr 30, 2015 at 12:21:32AM +0800, Zhuang Jin Can wrote: > > On Wed, Apr 29, 2015 at 01:06:22PM +0200, Greg KH wrote: > > > On Wed, Apr 29, 2015 at 06:57:30PM +0800, Zhuang Jin Can wrote: > > > > On W

Re: [PATCH] usb: core: add usb3 lpm sysfs

2015-04-29 Thread Zhuang Jin Can
On Wed, Apr 29, 2015 at 01:06:22PM +0200, Greg KH wrote: > On Wed, Apr 29, 2015 at 06:57:30PM +0800, Zhuang Jin Can wrote: > > On Wed, Apr 29, 2015 at 11:01:48AM +0200, Greg KH wrote: > > > On Wed, Apr 29, 2015 at 03:20:04PM +0800, Zhuang Jin Can wrote: > > > > On T

Re: [PATCH] usb: core: add usb3 lpm sysfs

2015-04-29 Thread Zhuang Jin Can
On Wed, Apr 29, 2015 at 11:01:48AM +0200, Greg KH wrote: > On Wed, Apr 29, 2015 at 03:20:04PM +0800, Zhuang Jin Can wrote: > > On Tue, Apr 28, 2015 at 11:11:10PM +0200, Greg KH wrote: > > > On Wed, Apr 29, 2015 at 12:51:27AM +0800, Zhuang Jin Can wrote: > > > > Hi Gr

Re: [PATCH] usb: core: add usb3 lpm sysfs

2015-04-29 Thread Zhuang Jin Can
On Tue, Apr 28, 2015 at 11:11:10PM +0200, Greg KH wrote: > On Wed, Apr 29, 2015 at 12:51:27AM +0800, Zhuang Jin Can wrote: > > Hi Greg KH, > > > > On Tue, Apr 28, 2015 at 12:42:24PM +0200, Greg KH wrote: > > > On Sun, Apr 19, 2015 at 11:46:12AM +0800, Zhuang Ji

Re: [PATCH] usb: core: add usb3 lpm sysfs

2015-04-28 Thread Zhuang Jin Can
Hi Greg KH, On Tue, Apr 28, 2015 at 12:42:24PM +0200, Greg KH wrote: > On Sun, Apr 19, 2015 at 11:46:12AM +0800, Zhuang Jin Can wrote: > > Some usb3 devices may not support usb3 lpm well. > > The patch adds a sysfs to enable/disable u1 or u2 of the port.The > > settings app

Re: [PATCH] usb: core: add usb3 lpm sysfs

2015-04-22 Thread Zhuang Jin Can
+ Mathias and David. Hi Mathias, Please help to review this patch. Thanks Jincan On Sun, Apr 19, 2015 at 11:46:12AM +0800, Zhuang Jin Can wrote: > Some usb3 devices may not support usb3 lpm well. > The patch adds a sysfs to enable/disable u1 or u2 of the port.The > settings appl

[PATCH] usb: core: add usb3 lpm sysfs

2015-04-18 Thread Zhuang Jin Can
2 is enabled, "u1_u2" - u1 and u2 are enabled. The interface is useful for testing some USB3 devices during development, and provides a way to disable usb3 lpm if the issues can not be fixed in final products. Signed-off-by: Zhuang Jin Can --- Documentation/ABI/testing/sysfs-bus

[PATCH] Revert "usb: Reset USB-3 devices on USB-3 link bounce"

2015-01-26 Thread Zhuang Jin Can
This revert a82b76f7fa6154e8ab2d8071842a3e38b9c0d0ff. The commit causes an extra reset in remote wakeup as described in: http://www.spinics.net/lists/linux-usb/msg119080.html Signed-off-by: Zhuang Jin Can --- drivers/usb/core/hub.c | 34 +- 1 file changed, 9

[PATCH] usb: dwc3: gadget: Fix desc NULL pointer in dwc3_gadget_ep_queue()

2014-09-02 Thread Zhuang Jin Can
dep->endpoint.desc is checked at the beginning of dwc3_gadget_ep_queue(), but after that it may be set to NULL by another thread and then accessed again in dwc3_gadget_ep_queue(). This will lead to kernel oops. Expand spinlock protection area to aviod race condition. Signed-off-by: Zhuang

[PATCH] usb: gadget: f_fs: add usb_functionfs_descs_head_v2

2014-09-01 Thread Zhuang Jin Can
Add usb_functionfs_descs_head_v2 structure for the new layout of descriptors. Signed-off-by: Zhuang Jin Can --- include/uapi/linux/usb/functionfs.h |9 + 1 file changed, 9 insertions(+) diff --git a/include/uapi/linux/usb/functionfs.h b/include/uapi/linux/usb/functionfs.h index

Re: [PATCH] usb: dwc3: gadget: check link trb after free_slot is increased

2014-05-16 Thread Zhuang Jin Can
Hi, On Fri, May 16, 2014 at 07:41:06AM -0500, Felipe Balbi wrote: > On Fri, May 16, 2014 at 11:50:13PM +0800, Zhuang Jin Can wrote: > > > On Fri, May 16, 2014 at 05:57:57AM +0800, Zhuang Jin Can wrote: > > > > In ISOC transfers, when free_slot points to the last TRB (i.e

Re: [PATCH] usb: dwc3: gadget: check link trb after free_slot is increased

2014-05-15 Thread Zhuang Jin Can
Hi On Thu, May 15, 2014 at 10:37:57AM -0500, Felipe Balbi wrote: > Hi > > On Fri, May 16, 2014 at 05:57:57AM +0800, Zhuang Jin Can wrote: > > In ISOC transfers, when free_slot points to the last TRB (i.e. Link > > TRB), and all queued requests meet Missed Interval

[PATCH] usb: dwc3: gadget: check link trb after free_slot is increased

2014-05-15 Thread Zhuang Jin Can
cks it before increasement. free_slot should behave the same as busy_slot to make the trb_left caculation correct. Signed-off-by: Zhuang Jin Can Signed-off-by: Jiebing Li --- drivers/usb/dwc3/gadget.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/gadg

Re: [PATCH] usb: dwc3: ep0: fix delayed status is queued too early

2014-05-13 Thread Zhuang Jin Can
On Tue, May 13, 2014 at 10:05:34AM -0500, Felipe Balbi wrote: > Hi, > > On Tue, May 13, 2014 at 09:45:51PM -0400, Zhuang Jin Can wrote: > > Hi Balbi, > > > > Do you have any comment for this patch? > > do you have an easy test-case which I can use to v

Re: [PATCH] usb: dwc3: ep0: fix delayed status is queued too early

2014-05-13 Thread Zhuang Jin Can
Hi Balbi, Do you have any comment for this patch? Thanks Jincan On Wed, May 07, 2014 at 05:53:44PM -0400, Zhuang Jin Can wrote: > A delayed status request may be queued before composite framework returns > USB_GADGET_DELAYED_STATUS, because the thread queueing the request can run

Re: [PATCH] usb: dwc3: ep0: fix delayed status is queued too early

2014-05-08 Thread Zhuang Jin Can
On Thu, May 08, 2014 at 11:22:36AM -0400, Alan Stern wrote: > On Thu, 8 May 2014, Zhuang Jin Can wrote: > > > > dwc3 _cannot_ return NYET to a SETUP packet. The USB protocol does not > > > allow it. A device must always respond to SETUP with ACK. > > It true that

Re: [PATCH] usb: dwc3: ep0: fix delayed status is queued too early

2014-05-08 Thread Zhuang Jin Can
On Thu, May 08, 2014 at 10:25:46AM -0400, Alan Stern wrote: > On Thu, 8 May 2014, Zhuang Jin Can wrote: > > > > When the host already timed out the control transfer and started a new > > > one. Here's what I'm talking about: > > > >

Re: [PATCH] usb: dwc3: ep0: fix delayed status is queued too early

2014-05-07 Thread Zhuang Jin Can
On Wed, May 07, 2014 at 12:59:06PM -0400, Alan Stern wrote: > On Thu, 8 May 2014, Zhuang Jin Can wrote: > > > > A similar problem can occur in the opposite sense: The thread queuing > > > the delayed status request might be delayed for so long that another > > > S

Re: [PATCH] usb: dwc3: ep0: fix delayed status is queued too early

2014-05-07 Thread Zhuang Jin Can
On Wed, May 07, 2014 at 11:03:42AM -0400, Alan Stern wrote: > On Wed, 7 May 2014, Zhuang Jin Can wrote: > > > A delayed status request may be queued before composite framework returns > > USB_GADGET_DELAYED_STATUS, because the thread queueing the request can run > >

[PATCH] usb: dwc3: ep0: fix delayed status is queued too early

2014-05-07 Thread Zhuang Jin Can
elayed_status is not cleared. Signed-off-by: Zhuang Jin Can Reported-by: Zhou Liping --- drivers/usb/dwc3/ep0.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index 21a3520..07292c0 100644 --- a/drivers/usb/dwc3/ep0.c +++

Re: [PATCH] usb: dwc3: gadget: giveback request if start transfer fail

2014-05-02 Thread Zhuang Jin Can
Hi, On Thu, May 01, 2014 at 10:13:28AM -0500, Felipe Balbi wrote: > On Thu, May 01, 2014 at 04:44:52PM -0400, Zhuang Jin Can wrote: > > On Wed, Apr 30, 2014 at 02:58:29PM -0500, Felipe Balbi wrote: > > > On Thu, May 01, 2014 at 02:36:08AM -0400, Zhuang Jin Can wrote: > >

Re: [PATCH] usb: dwc3: gadget: fix burst size corruption

2014-05-02 Thread Zhuang Jin Can
Hi, On Thu, May 01, 2014 at 10:15:00AM -0500, Felipe Balbi wrote: > On Thu, May 01, 2014 at 09:45:17AM -0400, Alan Stern wrote: > > On Thu, 1 May 2014, Zhuang Jin Can wrote: > > > > again, you found a bug on the gadget driver. Fix that. composite.c > > > > gu

Re: [PATCH] usb: dwc3: gadget: fix burst size corruption

2014-05-01 Thread Zhuang Jin Can
On Wed, Apr 30, 2014 at 03:03:53PM -0500, Felipe Balbi wrote: > On Thu, May 01, 2014 at 03:16:04AM -0400, Zhuang Jin Can wrote: > > endpoint.maxburst may be 0 if a gadget doesn't call config_ep_by_speed() > > to update it from the companion descriptor. > > And endpoint.m

Re: [PATCH] usb: dwc3: gadget: giveback request if start transfer fail

2014-05-01 Thread Zhuang Jin Can
Hi Balbi, On Wed, Apr 30, 2014 at 02:58:29PM -0500, Felipe Balbi wrote: > On Thu, May 01, 2014 at 02:36:08AM -0400, Zhuang Jin Can wrote: > > At least we should giveback the current request to the > > gadget. Otherwise, the gadget will be stuck without knowing > > anyt

[PATCH] usb: dwc3: gadget: fix burst size corruption

2014-04-30 Thread Zhuang Jin Can
mmand can't get the corret endpoint state and "Set Endpoint Config" command can't restore the correct endpoint state during hibernation resume flow. Thus, when endpoint.maxburst is 0, we should set burst as 0 directly. Signed-off-by: Zhuang Jin Can --- drivers/usb/dwc3/gad

[PATCH] usb: dwc3: gadget: giveback request if start transfer fail

2014-04-30 Thread Zhuang Jin Can
At least we should giveback the current request to the gadget. Otherwise, the gadget will be stuck without knowing anything. It was oberved that the failure can happen if the request is queued when the run/stop bit of controller is not set. Signed-off-by: Zhuang Jin Can --- drivers/usb/dwc3

Re: [PATCH] usb: dwc3: debugfs: add snapshot to dump requests trbs events

2014-04-30 Thread Zhuang Jin Can
On Wed, Apr 30, 2014 at 12:14:42PM -0500, Felipe Balbi wrote: > sorry but your patch is not good for acceptance in mainline. > Thanks your time. Jincan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordom

Re: [PATCH] usb: dwc3: debugfs: add snapshot to dump requests trbs events

2014-04-30 Thread Zhuang Jin Can
Hi, On Tue, Apr 29, 2014 at 11:10:42AM -0500, Felipe Balbi wrote: > Hi, > > On Tue, Apr 29, 2014 at 05:21:42PM -0400, Zhuang Jin Can wrote: > > On Mon, Apr 28, 2014 at 10:55:36AM -0500, Felipe Balbi wrote: > > > On Mon, Apr 28, 2014 at 04:49:23PM -0400, Zhuang Jin C

Re: [PATCH] usb: dwc3: debugfs: add snapshot to dump requests trbs events

2014-04-29 Thread Zhuang Jin Can
On Mon, Apr 28, 2014 at 10:55:36AM -0500, Felipe Balbi wrote: > On Mon, Apr 28, 2014 at 04:49:23PM -0400, Zhuang Jin Can wrote: > > Adds a debugfs file "snapshot" to dump dwc3 requests, trbs and events. > > you need to explain what are you trying to provide to our users