Hey all,
As a newbie, I'm trying to figure out how to properly deal with timeouts for dma_engine_submit(). I'm using a """prototype""" kernel module that sits on-tops of the Xilinx AXIDMA driver as part of Xilinx's Linux fork. They do a good job of merging with upstream kernels but there are some Xilinx-specific things and I apologize if some information is hard to parse. I believe my question is generic to the DMA Engine framework. This module, called "dma-proxy" is discussed a lot by Xilinx forums members but information doesn't typically flow back to users where there are fixes. Aside from the "dma-proxy" driver, Xilinx also includes a "AXIDMA Test" driver. Both drivers sit atop of the Xilinx DMA driver and do various things. The "dma-proxy" does some sharing of memory between userspace and the kernel but that's not really important to my question.
First, this chain eventually resolves into `dma_engine_submit()`:
-----------------------------------------------------------------
if (! chan_desc) {
printk(KERN_ERR "dmaengine_prep*() error\n");
else { ... }
Then, the driver waits for the completion and prints an error if it cannot complete:
-------------------------------------------------------------------------------------------------------------------
unsigned long timeout = msecs_to_jiffies(3000);
timeout = wait_for_completion_timeout(foo.cmp, timeout);
status = dma_async_is_tx_complete(..., ..., NULL, NULL);
if (timeout == 0) {
printk(KERN_ERR "DMA timed out\n");
}
else { ... }
======
I cannot figure out what to do in the case of a timeout. It appears descriptors (chan_desc) are being leaked when completion cannot be completed. I see some patches to make the list of descriptors larger but it appears the default/configured is 255. So if I sit and timeout for 3sec * 255, I run out of descriptors and that DMA engine instance is no longer usable.
I hope someone can point me in the right direction so I can timeout nicely.
Thanks!
-- Anthony G. Clark
Gtalk :: clark.anthony.g
Phone :: 951 526 5237