On Thu, Jul 9, 2020 at 12:57 AM Gerd Hoffmann <kra...@redhat.com> wrote:
> > 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 > > Hi Gerd, Hey, that works! But we still need to keep the rest of 7ad3d51ebb8a, or else s->data_len eventually goes negative and we hit the assertion on line 447 "Assertion `le32_to_cpu(s->csw.residue) == 0' failed. But with that, hcd-dwc2 seems to work fine, and also the error messages that Sai saw with hcd-xhci are gone. Do you want to submit the patch for this? Thanks, Paul