Hi, >> >> In my udc driver, i set the req->length to the number of bytes i >> >> received from HW, which is 31 bytes. Is it necessary to do that? How >> > >> > you shouldn't touch req->lenght, you should only update req->actual. >> > req->length is readonly for the UDC. >> > >> >> to know the gadget driver queued 0-bytes? By >> >> bh->bulk_out_intended_length ? >> > >> > read req->length >> > >> >> i removed setting the req->length in udc driver. Now in the >> bulk_out_complete(), the value of req->length is 512. who set it to >> 512? > > Read the code and you will figure it out. Here are the last two setup data and CBW data received. the get_next_command() is not called when CBW data is received. the bulk_out_complete() wakes up the thread, however, get_next_command() still sleeps. i do not see where req->length is checked in gadget driver. g_file_storage gadget: ep0-setup, length 8: 00000000: 00 09 01 00 00 00 00 00 g_file_storage gadget: set configuration g_file_storage gadget: ep0-setup, length 8: 00000000: a1 fe 00 00 00 00 01 00 g_file_storage gadget: get max LUN g_file_storage gadget: ep0-in, length 1: 00000000: 00 g_file_storage gadget: bulk-out, length 31: 00000000: 55 53 42 43 a8 48 ed 86 24 00 00 00 80 00 06 12 00000010: 00 00 00 24 00 00 00 00 00 00 00 00 00 00 00 g_file_storage gadget: bulk_out_complete --> 0, 31/0 victor -- 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