Hi,

I am running usbtest #14 with the isp1160 chip as a host and
net2280 based pci card as gadget with g_zero driver. About
2-3 times of 1000 runs, the test fails with the messages
like that:

usbtest 1-1:3.0: ctrl_out, byte 64 is 138 not 134

where in the particular case it transferred 69 bytes. The
failure seems more or less random; though the following
features seem to be always present:

1. It is an odd number of bytes to transfer.
2. The full Maxpacket-size chunks are transferred correctly,
the first wrong byte resides at the beginning of the "short"
packet.
3. The bytes in the wrong data are reordered, but I haven't
recognized a pattern in reordering. In the particular case
there are just bytes 86 and 8a swapped, but with more data
in the short packet, the reordering is more complex.

I suspect that the problem occurs in the gadget side. Here
is a summary of how the test failed and below come the logs.

- the data (69 bytes) is written into the HC fifo
- the data is transferred over the usb bus to gadget
- the data is read back from the HC fifo and it is correct
(exactly the same that was written in)

- the data (69 bytes) is read by gadget into the
req->buf; the data is incorrect!!!
- the following message is issued to the logs:
zero gadget: zero_setup_complete: setup complete --> -75, 69/69

- the data is requested back from the gadget by HC
- 69 bytes are obtained and the data is incorrect, being
the exact copy of the incorrect data seen already in the
g_zero driver

I don't have a USB analyzer, therefore it wouldn't be
trivial for me to check the data on the wire.

Has anybody seen something like that earlier? How to debug
this further?

Olav

-------Host side-------------------------------

# Sending Setup packet with 5b command, not shown

# OUT data, written to fifo (plus PTD header)

CC=f EP=0 DIR=1 CNT=0 LEN=69 MPS=64 TGL=1 ACT=1 FA=3 SPD=0
LST=1 B5=0
  fc00 0840 0445 0003
--out-> 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56
57 58 59 5a 5b 5c 5
d 5e 5f 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70
71 72 73 74 75 76 7
7 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a

# the same OUT data, read back. Data is identical to the
# data above. Header's CC==0 shows that transfer succeeded.

CC=0 EP=0 DIR=1 CNT=69 LEN=69 MPS=64 TGL=1 ACT=0 FA=3 SPD=0
LST=1 B5=0
  0445 0840 0445 0003
<--in-- 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56
57 58 59 5a 5b 5c 5
d 5e 5f 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70
71 72 73 74 75 76 7
7 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a

# Status ok (not shown)

# Setup with 5c command sent (not shown)

# Request IN data (write 69 bytes of correct data into
# the fifo). This will initiate transfer on the USB.

CC=f EP=0 DIR=2 CNT=0 LEN=69 MPS=64 TGL=1 ACT=1 FA=3 SPD=0
LST=1 B5=0
  fc00 0840 0845 0003
--out-> 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56
57 58 59 5a 5b 5c 5
d 5e 5f 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70
71 72 73 74 75 76 7
7 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a

# Read data from fifo. Transfer succeeded as CC==0. Bytes
# 86 and 8a are swapped.

CC=0 EP=0 DIR=2 CNT=69 LEN=69 MPS=64 TGL=1 ACT=0 FA=3 SPD=0
LST=1 B5=0
  0445 0840 0845 0003
<--in-- 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56
57 58 59 5a 5b 5c 5
d 5e 5f 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70
71 72 73 74 75 76 7
7 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 8a 87 88 89 86

# Status sent. Test fails with the message:

usbtest 1-1:3.0: ctrl_out, byte 64 is 138 not 134

------Gadget side-----------------------
After adding data dumping at failure into g_zero's
zero_setup_complete() function, I got the following
into the log. Note that the data is incorrect exactly as
what the HC gets from the wire.

Jan 31 15:27:20 pcx kernel: zero gadget: reset config
Jan 31 15:27:20 pcx kernel: zero gadget: buflen 4096
Jan 31 15:27:32 pcx kernel: zero gadget:
zero_setup_complete: setup complete --> -75, 69/69
Jan 31 15:27:32 pcx kernel:
data: 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53
54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 67
68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a 7b
7c 7d 7e 7f 80 81 82 83 84 85 8a 87 88 89 86




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to