today I tested more the ehci code and my results are as follows.
David Brownell wrote:
You should explain more about your tests. Sounds like IN transfers
with two 1KB packets per uframe. How big are your URBs ... how many
uframes each? And how deep is your URB queue? Are these "errors"
paired with urb->iso_frame_desc[i].status faults, or do you just see
strange looking data landing in the buffers? Do you maybe have any
CATC confirmation what's going on?
My iso stream is IN transfers with 2000 bytes per uframe (two packets). I used URB queue of depth 2 and later of depth 2 - 100. The depth of URB queue didn't have any influence on error rate. I found out that the error rate depends only on number of frames per URB. When there are 2, 4 or 8 frames per URB, the tranfer is without errors. When there are 3,5-7,9-24... frames per urb there are errors.
That errors look like there is a chunk of valid data whose length varies depending on the number of frames per urb (see bellow) and after this there is a small chunk of total mess. Size of this chunk is almost a small multiple of one urb transaction (2000 bytes) but sometimes it is for example 4472 bytes long.
I have measured how the length of chunks depends on uframes per urb and here are results:
*frames per urb
* *lengths of valid data
* *length of mess
*
16
27520
4472
12
11520, 27712
11
2000, 43712, 27520, ......
10
12000, 11712, 14000, 30000
4000
6
14000, 28000
2000If there are more than one vlaue in second column, it means there have been alternating chunks of diferent lengths. I didn't measure the lenght of the mess very carfully so there may be some other lengths of mess.
Because patterns of valid and invalid data are very regular, I think that it may be a bug in itd sheduling.
It might help if you were to post copies of the EHCI debug files, made while your tests are running. They're found in /sys/class/usb_host for the bus (probably "usb1"), and they most interesting ones here will be called "periodic" and "registers". And of course, if there were any debug messages from EHCI that'd be good too.
Copies of that files are attached. The number in a file name means the number of uframes per urb.
Michal
ehci-dbgfiles.tar.gz
Description: Zip archive
