UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer thburghout
Observer
537 Views
Registered: ‎10-27-2017

Queue DMA transactions

Hi all,

 

I'm looking for some information about dmaengine_submit(). In my original code I submitted a new transaction whenever the callback was called. This turned out to be too slow, causing me to miss some data. Now I'm trying to submit multiple transactions at once, but this doesn't seem to be working either.

 

As soon as the first transaction completes it seems to have "handled" all submitted transactions. The callback is called n times (n = number of transactions submitted) with the actual data only present in the buffer belonging to the first transaction.

 

I was under the impression that dmaengine_submit() would queue various transactions, is this not the case?

 

Thanks!

Thomas

0 Kudos
1 Reply
Highlighted
Observer thburghout
Observer
530 Views
Registered: ‎10-27-2017

Re: Queue DMA transactions

My code look somewhat like this:

 

enum dma_ctrl_flags flags = DMA_CTRL_ACK | DMA_PREP_INTERRUPT;
struct dma_async_tx_descriptor *chan_desc;

for (int i = 0; i < BUFFER_SIZE; ++i) {
    r[i].dma_handle = dma_map_single(dev, r[i].data, DATA_SIZE, DMA_FROM_DEVICE);
    chan_desc = dmaengine_prep_slave_single(rx_chan, r[i].dma_handle, SCAN_SIZE, DMA_DEV_TO_MEM, flags);
    // error checking
    chan_desc->callback = axidma_sync_callback;
    r[i].dma_cookie = dmaengine_submit(chan_desc);
}

dma_async_issue_pending(rx_chan);
0 Kudos