On Fri, Mar 15, 2013 at 11:00:45AM -0400, Alan Stern wrote: > On Fri, 15 Mar 2013, Felipe Balbi wrote: > > > On Fri, Mar 15, 2013 at 04:26:10PM +0800, victor yeo wrote: > > > Hi, > > > > > > > On Fri, Mar 15, 2013 at 01:59:30PM +0800, victor yeo wrote: > > > >> For bulk transfer, the new UDC driver has one problem. When SCSI > > > >> Inquiry command is received, the UDC driver interrupt routine will > > > >> receive it first. However, the queue function is not yet called, and > > > >> queue buffer is not yet added. Thus, interrupt routine is not able to > > > >> store the SCSI Inquiry command to the queue buffer. > > > >> > > > >> This is a serious problem, what is the way to synchronise UDC driver > > > >> and file storage gadget driver for SCSI command bulk transfer? > > > > > > > > don't process the interrupt until you receive a queue. Data will be > > > > pending in controller's FIFO until then. > > > > > > > > > > change to do exactly that, bulk transfer interrupt come in, don't > > > process, then queue function is called to add queue buffer. After > > > that, no more bulk transfer interrupt come in. > > > > did you process the pending data from FIFO after queue was called ? > > I'm not sure about the details of how the controller hardware works. > But what should happen is this: When the controller receives the bulk > packet containing the INQUIRY command, it should send back NAK until it > has a buffer ready to store the packet. right, with all controllers I have seen so far, this means just not processing the interrupt, AKA not starting a transfer. -- balbi
Attachment:
signature.asc
Description: Digital signature