Re: Some restrictions when using usbtest and g_zero

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 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
> pass USB CV2.0 MSC TEST. (othwerwise, "Command Set Test - Device Configured"
> will fail)

The USB spec isn't very clear about this.  All it says about the
Set-Halt request is:

	When set by the SetFeature() request, the endpoint exhibits the
	same stall behavior as if the field had been set by a hardware
	condition.

But if there's a pending request, many UDC drivers are unable to set 
the HALT feature -- even due to a hardware condition.

I suppose the right thing is for the UDC to temporarily disable the
endpoint, set the HALT feature, and then re-enable the endpoint (along
with the pending request).  But changing a bunch of UDC drivers for
such a minor thing doesn't seem worthwhile.

> - The parameter 'vary' must be the same with 'length' when do bulk/iso
> READ test, the host's packet size can't be smaller than device's.

You're talking about Test 4, right?  Yes, the host's packet size better
not be smaller than the device's.  But the transfer size could be
larger.  For example, 'vary' could be equal to the maxpacket size and
'length' could 3*(maxpacket size).

> And 'vary' must be smaller than 'length' when do ctrl test.

'vary' should always be < 'length', even for bulk/iso tests.

> - When using pattern = 1 as module parameters to compare the data, the
> packet size must be same between host and device's.

Yes, there's a comment about that in the simple_check_buf() routine:

		/* mod63 stays in sync with short-terminated transfers,
		 * or otherwise when host and gadget agree on how large
		 * each usb transfer request should be.  ...

> So, I do the test, I need to write customize commands for kinds of tests

It's quite true that blindly running the test program doesn't always 
work.  You have to be careful about setting the parameters correctly 
for some of the tests.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux