Re: DMA

From: Dan Williams
Date: Sat Feb 05 2011 - 12:42:00 EST


On 02/04/2011 01:01 PM, mahdi hamzeh wrote:
Paul,

Thanks for your help. You were right. There was a version mismatch
between my header files and I got it fixed. I could compile all
related dma modules including async modules. However, I cannot use dma
engine because I receive following error when I run my code,
"__dma_request_channel: fail ((null))". Even I tried
Documentation/crypto/async-tx-api.txt but it turns out that when I
issue a transaction such that "async_memcpy" and I wait for
transaction to be completed by "wait_for_completion", it is never
completed. Is this problem related to my machine or my code?

Here is my code:

struct async_submit_ctl submit;
struct completion cmp;
init_completion(&cmp);
init_async_submit(&submit, flag, NULL, NULL,&cmp, addr_conv);
^^^^
Hmm... what's wrong with this parameter? ;-)

dma_cap_mask_t myMask;
dma_cap_zero(myMask);
dma_cap_set(DMA_PRIVATE, myMask); //I tried different combination of
flags like DMA_MEMCPY ,....
myDMAChannel = dma_request_channel(myMask, NULL, filter_param);

myDMAChannel is always NULL.

This is a bit more subtle. Depending on the driver and the kernel configuration all channels may already be consumed for "public" usage (NET_DMA and/or ASYNC_TX_DMA).

One way to sanity check your system is to turn off CONFIG_NET_DMA and CONFIG_ASYNC_TX_DMA and turn on CONFIG_DMATEST, load dmatest.ko and it should give a clue about whether dma is operational on your platform.

--
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/