Re: Some restrictions when using usbtest and g_zero

2015-08-24 Thread Alan Stern
On Mon, 24 Aug 2015, Peter Chen wrote: Thanks, that's much clear. At udc driver: __set_halt(struct usb_ep *ep, int value, bool may_fail) { if (may_fail ep queue is not empty) { return false } else { do stall; return true;

Re: Some restrictions when using usbtest and g_zero

2015-08-24 Thread Alan Stern
On Mon, 24 Aug 2015, Peter Chen wrote: On Thu, Aug 20, 2015 at 05:03:46PM -0400, Alan Stern wrote: On Thu, 20 Aug 2015, Felipe Balbi wrote: - When using pattern = 1 as module parameters to compare the data, the packet size must be same between host and device's.

Re: Some restrictions when using usbtest and g_zero

2015-08-24 Thread Felipe Balbi
On Mon, Aug 24, 2015 at 10:51:04AM -0400, Alan Stern wrote: On Mon, 24 Aug 2015, Peter Chen wrote: Thanks, that's much clear. At udc driver: __set_halt(struct usb_ep *ep, int value, bool may_fail) { if (may_fail ep queue is not empty) { return false }

Re: Some restrictions when using usbtest and g_zero

2015-08-24 Thread Felipe Balbi
On Mon, Aug 24, 2015 at 11:43:21AM -0400, Alan Stern wrote: On Mon, 24 Aug 2015, Peter Chen wrote: On Thu, Aug 20, 2015 at 05:03:46PM -0400, Alan Stern wrote: On Thu, 20 Aug 2015, Felipe Balbi wrote: - When using pattern = 1 as module parameters to compare the data, the

Re: Some restrictions when using usbtest and g_zero

2015-08-24 Thread Alan Stern
On Mon, 24 Aug 2015, Felipe Balbi wrote: Maybe we should add a vendor-specific control request to gadget Zero so that the host can tell the gadget what the transfer size will be. I proposed that many months ago and you were against it, remember ? I believe you -- it sounds like the sort

Re: Some restrictions when using usbtest and g_zero

2015-08-24 Thread Peter Chen
On Fri, Aug 21, 2015 at 10:16:30AM -0400, Alan Stern wrote: On Fri, 21 Aug 2015, Peter Chen wrote: Thanks, Alan and Felipe. My problem should be the chipidea udc driver does not support functional stall well, it fixes the handling between functional and protocol stall. My

Re: Some restrictions when using usbtest and g_zero

2015-08-24 Thread Peter Chen
On Thu, Aug 20, 2015 at 05:03:46PM -0400, Alan Stern wrote: On Thu, 20 Aug 2015, Felipe Balbi wrote: - When using pattern = 1 as module parameters to compare the data, the packet size must be same between host and device's. why ? The gadget stores the pattern data

Re: Some restrictions when using usbtest and g_zero

2015-08-24 Thread Peter Chen
On Mon, Aug 24, 2015 at 10:53:50AM -0500, Felipe Balbi wrote: On Mon, Aug 24, 2015 at 10:51:04AM -0400, Alan Stern wrote: On Mon, 24 Aug 2015, Peter Chen wrote: Thanks, that's much clear. At udc driver: __set_halt(struct usb_ep *ep, int value, bool may_fail) { if

Re: Some restrictions when using usbtest and g_zero

2015-08-24 Thread Peter Chen
On Mon, Aug 24, 2015 at 02:17:08PM -0400, Alan Stern wrote: On Mon, 24 Aug 2015, Felipe Balbi wrote: Maybe we should add a vendor-specific control request to gadget Zero so that the host can tell the gadget what the transfer size will be. I proposed that many months ago and you were

Re: Some restrictions when using usbtest and g_zero

2015-08-21 Thread Alan Stern
On Fri, 21 Aug 2015, Peter Chen wrote: Thanks, Alan and Felipe. My problem should be the chipidea udc driver does not support functional stall well, it fixes the handling between functional and protocol stall. My understanding for these two stalls: - Functional stall, the host stalls

Re: Some restrictions when using usbtest and g_zero

2015-08-21 Thread Alan Stern
On Fri, 21 Aug 2015, Peter Chen wrote: Thanks. I don't have much time to debug this problem deeply today. Below are some information: - The parameter 'stall' is y for g_mass_storage - The stall bulk-IN is from the line 1571 at f_mass_storage.c If I do not stall this bulk-IN, and

Re: Some restrictions when using usbtest and g_zero

2015-08-21 Thread Peter Chen
On Thu, Aug 20, 2015 at 12:41:26PM -0500, Felipe Balbi wrote: Hi, pass USB CV2.0 MSC TEST. (othwerwise, Command Set Test - Device Configured will fail) Why would a pending struct usb_request in your queue fail USB CV ? _Lack_ of a pending request can

Re: Some restrictions when using usbtest and g_zero

2015-08-21 Thread Peter Chen
On Thu, Aug 20, 2015 at 04:58:13PM -0400, Alan Stern wrote: On Thu, 20 Aug 2015, Felipe Balbi wrote: Doesn't Peter need to cope with differentiating protocol vs non-protocol stalls ? Those matter only for ep0, not for bulk/interrupt. huh ? usbtest send SetFeature(HALT) for

Some restrictions when using usbtest and g_zero

2015-08-20 Thread Peter Chen
Hi all, I have played usbtest and g_zero (f_sourcesink f_loopback) to do the tests between two boards these days, and have found some restrictions, I list them here, and to see if they are common problems and can be improved or not. - Test 13 will fail due to there is pending IN request

Re: Some restrictions when using usbtest and g_zero

2015-08-20 Thread Alan Stern
On Thu, 20 Aug 2015, Felipe Balbi wrote: - Test 13 will fail due to there is pending IN request (f_sourcesink will queue a request unconditionally at its completion), and udc driver will run out error if that. udc driver must do that if it wants to wait, what ? test 13 works

Re: Some restrictions when using usbtest and g_zero

2015-08-20 Thread Felipe Balbi
Hi, On Thu, Aug 20, 2015 at 01:08:30PM -0400, Alan Stern wrote: On Thu, 20 Aug 2015, Felipe Balbi wrote: - Test 13 will fail due to there is pending IN request (f_sourcesink will queue a request unconditionally at its completion), and udc driver will run out error if that.

Re: Some restrictions when using usbtest and g_zero

2015-08-20 Thread Felipe Balbi
Hi, On Thu, Aug 20, 2015 at 04:25:08PM +0800, Peter Chen wrote: Hi all, I have played usbtest and g_zero (f_sourcesink f_loopback) to do the tests between two boards these days, and have found some restrictions, I list them here, and to see if they are common problems and can be improved

Re: Some restrictions when using usbtest and g_zero

2015-08-20 Thread Alan Stern
On Thu, 20 Aug 2015, Peter Chen wrote: Hi all, I have played usbtest and g_zero (f_sourcesink f_loopback) to do the tests between two boards these days, and have found some restrictions, I list them here, and to see if they are common problems and can be improved or not. - Test 13 will

Re: Some restrictions when using usbtest and g_zero

2015-08-20 Thread Alan Stern
On Thu, 20 Aug 2015, Felipe Balbi wrote: Hi, On Thu, Aug 20, 2015 at 04:25:08PM +0800, Peter Chen wrote: Hi all, I have played usbtest and g_zero (f_sourcesink f_loopback) to do the tests between two boards these days, and have found some restrictions, I list them here, and to see

Re: Some restrictions when using usbtest and g_zero

2015-08-20 Thread Alan Stern
On Thu, 20 Aug 2015, Felipe Balbi wrote: Doesn't Peter need to cope with differentiating protocol vs non-protocol stalls ? Those matter only for ep0, not for bulk/interrupt. huh ? usbtest send SetFeature(HALT) for the bulk endpoint, right ? That's what Peter's UDC driver is

Re: Some restrictions when using usbtest and g_zero

2015-08-20 Thread Alan Stern
On Thu, 20 Aug 2015, Felipe Balbi wrote: - When using pattern = 1 as module parameters to compare the data, the packet size must be same between host and device's. why ? The gadget stores the pattern data starting from 0 for each packet it sends. But the host tests the

Re: Some restrictions when using usbtest and g_zero

2015-08-20 Thread Felipe Balbi
Hi, On Thu, Aug 20, 2015 at 10:48:15AM -0400, Alan Stern wrote: On Thu, 20 Aug 2015, Felipe Balbi wrote: Hi, On Thu, Aug 20, 2015 at 04:25:08PM +0800, Peter Chen wrote: Hi all, I have played usbtest and g_zero (f_sourcesink f_loopback) to do the tests between two boards

Re: Some restrictions when using usbtest and g_zero

2015-08-20 Thread Felipe Balbi
On Thu, Aug 20, 2015 at 10:40:17AM -0400, Alan Stern wrote: On Thu, 20 Aug 2015, Peter Chen wrote: Hi all, I have played usbtest and g_zero (f_sourcesink f_loopback) to do the tests between two boards these days, and have found some restrictions, I list them here, and to see if they

Re: Some restrictions when using usbtest and g_zero

2015-08-20 Thread Alan Stern
On Thu, 20 Aug 2015, Felipe Balbi wrote: Hi, On Thu, Aug 20, 2015 at 01:08:30PM -0400, Alan Stern wrote: On Thu, 20 Aug 2015, Felipe Balbi wrote: - Test 13 will fail due to there is pending IN request (f_sourcesink will queue a request unconditionally at its completion), and

Re: Some restrictions when using usbtest and g_zero

2015-08-20 Thread Felipe Balbi
On Thu, Aug 20, 2015 at 04:12:24PM -0400, Alan Stern wrote: On Thu, 20 Aug 2015, Felipe Balbi wrote: Hi, On Thu, Aug 20, 2015 at 01:08:30PM -0400, Alan Stern wrote: On Thu, 20 Aug 2015, Felipe Balbi wrote: - Test 13 will fail due to there is pending IN request