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 cause the USB CV to fail. In Peter's > > > > example, if you're testing a Mass-Storage gadget, USB CV requires that > > > > there be a pending Bulk-OUT request when the gadget is idle (so that > > > > the next SCSI command can be sent out). > > > > > > > > But if there's a pending usb_request on a bulk-OUT endpoint, will a UDC > > > > driver be able to carry out a Set-Halt-Feature request from the host? > > > > The answer isn't clear. And it's even worse for bulk-IN. > > > > > > how can USB CV even test that there is a pending request on the UDC's > > > side ? Short of actually moving data on that pipe, there's not way. > > > > That's exactly what the USB CV does -- it tries to send data. If it > > can't, the test fails. (At least, that's what I remember; it was a > > while ago that I looked at this.) > > > > However, in this respect Peter was a little inconsistent. The USB CV > > MSC test requires a pending bulk-OUT request, but the Set-Halt problem > > affects bulk-IN endpoints. > > right > 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 return -EAGAIN, the USB CV log like below, and the bus analyzer log at success.png Issuing Command Set Test for Op Code 0x12, Test Variation #7 INFO Issuing CBW (attempt #1): INFO |----- CBW LUN = 0x0 INFO |----- CBW Flags = 0x80 INFO |----- CBW Data Transfer Length = 0xff INFO |----- CBW CDB Length = 0x6 INFO |----- CBW CDB-00 = 0x12 INFO |----- CBW CDB-01 = 0x0 INFO |----- CBW CDB-02 = 0x0 INFO |----- CBW CDB-03 = 0x0 INFO |----- CBW CDB-04 = 0xff INFO |----- CBW CDB-05 = 0x0 INFO Issuing DATA IN INFO Issuing CSW : try 1 INFO CSW phase stalled, clear stall on CBW endpoint INFO Retrieving status on stalled CSW endpoint INFO CSW endpoint status = 0x1 INFO Issuing CSW : try 2 INFO CSW residue returned = 0xdb INFO CSW status returned = 0x0 INFO Getting Device Type If I do stall this bulk-IN, and return 0, the USB CV log like below, and the bus analyzer log at failure.png INFO Issuing Command Set Test for Op Code 0x12, Test Variation #7 INFO Issuing CBW (attempt #1): INFO |----- CBW LUN = 0x0 INFO |----- CBW Flags = 0x80 INFO |----- CBW Data Transfer Length = 0xff INFO |----- CBW CDB Length = 0x6 INFO |----- CBW CDB-00 = 0x12 INFO |----- CBW CDB-01 = 0x0 INFO |----- CBW CDB-02 = 0x0 INFO |----- CBW CDB-03 = 0x0 INFO |----- CBW CDB-04 = 0xff INFO |----- CBW CDB-05 = 0x0 INFO Issuing DATA IN INFO DATA phase stalled INFO Retrieving status on stalled bulk endpoint INFO Bulk endpoint status = 0x1 INFO Issuing CSW : try 1 INFO CSW Bulk Request failed with bus error! INFO Failed CSW phase : should have been success or stall ERROR BOTCommonMSCRequest failed: error=80004005 INFO Re-enumerating device INFO Detected hard error, issuing BOT MSC Reset INFO Allowing Errors on odd-byte transfers The difference between success and failure routine is, one is bulk-in is stalled at CSW stage, the other is at data stage. -- Best Regards, Peter Chen
Attachment:
failure.png
Description: PNG image
Attachment:
success.png
Description: PNG image