> Starting at line 1746 is the first CBW, it's for an Inquiry command.
> 
> Starting at line 1759 is the response, notice at line 1761 the MSD debug
> says "Data in 64/36", which is strange.

Not really.  First is the packet size, second is the (remaining) data
size.  Inquiry data is 36 bytes, and dwc2 uses 64 byte instead of 36
byte transfers.

> Then the MSD defers the packet, even though the full 36 bytes has
> already been received.

Yes, and this is the problem.  The condition checks whenever there is
room left in the usb packet.  But we should also check whenever there
is actually more data pending, so how about this:

    if (p->actual_length < p->iov.size && s->mode == USB_MSDM_DATAIN) {
        DPRINTF("Deferring packet %p [wait data-in]\n", p);

take care,
  Gerd


Reply via email to