Hi, Sorry for the delay getting back on this. I was offline for quite some time. On Thu, Apr 25, 2019 at 03:44:57PM -0700, Jack Pham wrote: > Hi Bin, > > On Mon, Apr 22, 2019 at 08:43:57AM -0500, Bin Liu wrote: > > Hi Felipe, > > > > I am having an issue with dwc3 on TI AM57x device, and would like to ask > > for your comments. > > > > I use configfs to create a multi-function gadget on dwc3, mass_storage > > is the last function, it seems if I create 3 functions, the mass_storage > > enumeration will fail on the host. It works fine if only create 2 > > functions. > > > > The dwc3 tracepoints log shows after all the ep0 transfers for > > mass_storage, the very first epXin transfer is not complete - dwc3 > > programmed the urb, but never generates RX completion event. This also > > matches the bus analyzer trace - dwc3 NAKs the very first IN token for > > ever. > > > > I use the attached script to create the gadget, The macro FUNCS in the > > beginning of the script defines the functions to be created. > > > > Any comments are appreciated. > > A stab in the dark here but what is the value of GTXFIFOSIZ(X)[15:0] > for epXin on your device? Is it at least wMaxPacketSize? Depending on > the default hardware values it might be deficient as compared to the > working endpoint that gets assigned in your 2-function config. Jack, thanks for the pointer, it is indeed the issue on AM57x device. The reset value of GTXFIFOSIZ for ep1~4 have size of 0x184, but ep5~15 have only size of 0x13 (which is 120 bytes), which is not enough for high-speed bulk xfers. I manually adjusted the fifo memory allocation, now my test case works. Felipe, Is there anything the dwc3 gadget driver can do to better handle this kind of devices, which don't have enough fifo buffers for all TX eps? -Bin.