On Mon, Mar 09, 2015 at 11:18:53PM +0100, Robert Jarzmik wrote: > Hi Vinod, > > I've been writing the dmaengine slave driver for pxa architecture lately. I have > only one remaining concern with descriptors reusing, and I need your input. > > My usecase is as follows, from a driver point of view : > - tx = dmaengine_prep_slave_sg(dma_chan, sg, sglen, DMA_PREP_CONTINUE); > - dma_map_sg(dev, sg, sglen, DMA_DEV_TO_MEM) > - dmaengine_submit(tx) > - dma_async_issue_pending(dma_chan); > - ... wait for tx->callback() > => here, because of DMA_PREP_CONTINUE, the hardware descriptors are not > freed, as what I need to reuse > > - dma_sync_sg_for_cpu(dev, sg, sglen, ) > - copy video buffer somewhere (or not if frame interleaving) > > - dmaengine_submit(tx) > - dma_async_issue_pending(dma_chan) > => the video buffer is captured again, so far so good > - ... wait for tx->callback() > > And here comes my question : how do I free the hardware descriptors for tx now ? > As I chose to not free them upon tx completion, is there an API call to do it ? The problem with this is that we are assuming the DMA_PREP_CONTINUE/DMA_PREP_ACK etc is valid for slave. These were defined for async_tx. I have added Dan on how they handled it there But, I think we should not use these for slave transactions. In your case what is the benefit you get from reusing the descriptors? Thanks -- ~Vinod -- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html