Hi, On Fri, Nov 30, 2012 at 12:02:25PM +0530, Supriya Karanth wrote: > From: supriya karanth <supriya.karanth@xxxxxxxxxxxxxx> > > Handles: > 1) Known transfer length > a) Non multiple of packet size > b) Multiple of packet size > > 2) Unknown transfer lengths > - Short packet indicates end of transfer > > ---------------> OUT Endpoint interrupt recieved > | | > | ____________________|_________________ > | | | > | -> No ongoing transfer ->DMA Transfer ongoing and RXPKTRDY set? > | | ->Short Packet recieved > | request queued? ->PAUSE DMA transfer, Read Residue > | | ________________|____________ > | | | | > | | residue!=0 residue=0 > | | -> abort DMA ->Resume DMA > | | ->Update request->actual_len ->Wait for DMA > | | -> Clear DMA bits in CSR completion > | | -> Read Short Packet | > | |__________________________| |______ > | | | > | call rxstate | > | ->RXPKTRDY set? Read RXCOUNT | > | _____________________|____________________ | > | | | | > | ->RXCOUNT == EP MAX packet Size ->RXCOUNT < EP MAX packet Size| > | ->Program DMA in Mode1 for length -> Program in PIO / Mode0 | > | which is multiple of packet -> Read Short packet from FIFO| > | size -> Update request->actual_len | > | | -> call musb_giveback | > | |________________________________________| | > |____________________________| | > | | | > | |____________________________________| > | | > | DMA completion interrupt recieved > | _______________________|_________________ > | | | > | ->req->len = req->actual ->req->len < req->actual > | ->Clear DMA bits -> Short packet expected > | ->Call musb_giveback ->Clear DMA bits > | | ->wait for next OUT > | |_________________________________________| > |_______________________________| > > Signed-off-by: Supriya Karanth <supriya.karanth@xxxxxxxxxxxxxx> > Signed-off-by: Praveena NADAHALLY <praveen.nadahally@xxxxxxxxxxxxxx> > Acked-by: Linus Walleij <linus.walleij@xxxxxxxxxx> I'm sorry but this is not enough. You're almost there, however. What you need to do is cleanup the entire rxstate() and txstate() functions. They need to be split into PIO and DMA counter-parts and DMA programming has to be done the same way for everybody. All of those is_$dma() checks need to go. Without that, this will never work for everybody. -- balbi
Attachment:
signature.asc
Description: Digital signature