Re: Linux USB file storage gadget with new UDC

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

 



On Thu, 11 Apr 2013, victor yeo wrote:

> Thanks, i do not know why UDC sent back a data packet containing more
> than 13 bytes in response to TEST UNIT READY command.

Sounds like you need to debug the UDC driver.

> Here is another usbmon trace attached in this email. There are two
> issues in this usbmon trace. Firstly, the CSW that is sent back in
> response to SCSI_READ_10 is wrong (wrong tag).
> 
> f2c92340 2379075608 S Bo:2:047:1 -115 31 = 55534243 11000000 00100000
> 80000a28 00000000 00000008 00000000 000000
> f2c92340 2379075737 C Bo:2:047:1 0 31 >
> f2c92ac0 2379075746 S Bi:2:047:1 -115 4096 <
> f2c92ac0 2382204478 C Bi:2:047:1 0 4096 = 00000000 00000000 00000000
> 00000000 00000000 00000000 00000000 00000000
> f2c92340 2382204489 S Bi:2:047:1 -115 13 <
> f2c92340 2382210596 C Bi:2:047:1 0 13 = 55534253 10000000 00000000 00

Maybe the UDC driver doesn't update some buffer contents properly, so
the same buffer gets sent twice.

(Also, it seems odd that there was a 3-second delay in the middle of
this command.  Maybe that is related to your problem somehow.  On the
other hand, all the READ commands in the log show a similar delay, even
though they are for only 4096 bytes.)

> Secondly, this CSW shows remote I/O error (-121).
> 
> f2c92340 2382422538 S Bo:2:047:1 -115 31 = 55534243 12000000 00100000
> 80000a28 00000000 00000008 00000000 000000
> f2c92340 2382422588 C Bo:2:047:1 0 31 >
> f3a2b5c0 2382422596 S Bi:2:047:1 -115 4096 <
> f3a2b5c0 2382448965 C Bi:2:047:1 -121 13 = 55534253 12000000 00100000 01
> f2c92340 2382448977 S Bi:2:047:1 -115 13 <

In this case the 4096 data bytes weren't sent at all.  Just the 13-byte 
CSW, which isn't supposed to be sent until the command ends.

> I am lost. Every time i connect Linux host to the USB gadget,
> different error scenario is shown in usbmon.

You need to find out what is happening inside the UDC driver.  Write
out a log message every time the gadget driver submits a request for
the bulk-in endpoint, and every time a bulk-in packet is sent, and 
every time a request completes.  Print out the first eight bytes or so 
of the buffer contents, so you can see if the right data is getting 
sent back to the host, plus whatever additional information might be 
helpful.  I can't debug your driver for you.

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