On Sat, 20 Apr 2013, victor yeo wrote: > Hi, > > >> When writing to USB gadget from Linux host, the SCSI_WRITE_10 command > >> is sent out from the Linux host, but the USB gadget receives zero > >> length packet. And after a long wait of 30 seconds, the Linux host > >> resets the connection (-104). The usbmon trace and the UDC driver log > >> are attached. > > > > The UDC log starts somewhere in the middle of the test, not at the > > beginning. It doesn't show what the gadget was doing when the error > > started. > > the linux log buffer fills up fast, and dmesg can only display so > much. i will try again. You can increase the log buffer size by building the kernel with a larger value of CONFIG_LOG_BUF_SHIFT. dmesg will display as much as you tell it to, using the -s option. > Meanwhile, i observed SCSI_READ_10 command received but not processed > by the gadget. The usbmon and UDC driver log are attached. > > 55534243 ba000000 00020000 80000a28 00000020 01000001 00000000 000000 > > The SCSI_READ_10 command above is received by the UDC driver and > passed to gadget driver. > > g_file_storage gadget: bulk-out, length 31: > 00000000: 55 53 42 43 ba 00 00 00 00 02 00 00 80 00 0a 28 > 00000010: 00 00 00 20 01 00 00 01 00 00 00 00 f8 9e 33 > > I think it is printed in bulk_out_complete(). But gadget driver does > not process it, no data is returned to the host, and (-104) is shown > in usbmon trace. Probably because the file_storage driver was already hung. To find out what's going wrong, it's important to see the logs starting from _before_ the time when the first error occurs. You should add some DBG lines to the fsg_main_thread routine so that you can see whether it gets hung in any of the calls to handle_exception, get_next_command, do_scsi_command, finish_reply, or send_status. 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