Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-03-2016, 04:09 PM   #1
LQ Newbie
Registered: Jul 2016
Posts: 5

Rep: Reputation: Disabled
Function dma_prep_slave_single fails, unknown cause.

I am attempting to write a kernel module to use the dmaengine system to access memory.

Currently I was able to successfully use dma_request_channel to get a dma_chan, and allocate a buffer for use in the transaction. The next thing I am attempting to do is create a channel_descriptor so that I can submit a transaction request to the dma engine. The way I believe this is done is using the function:

798 static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(
799 struct dma_chan *chan, dma_addr_t buf, size_t len,
800 enum dma_transfer_direction dir, unsigned long flags)
801 {
802 struct scatterlist sg;
803 sg_init_table(&sg, 1);
804 sg_dma_address(&sg) = buf;
805 sg_dma_len(&sg) = len;
807 if (!chan || !chan->device || !chan->device->device_prep_slave_sg)
808 return NULL;
810 return chan->device->device_prep_slave_sg(chan, &sg, 1,
811 dir, flags, NULL);
812 }

I have verified that the dma_request_channel did indeed return a pointer to a struct. I have included a handle generated with dma_map_single() for buf, used the kzalloc length for len, used DMA_FROM_DEVICE for dir, and the flags DMA_CTRL_ACK |DMA_PREP_INTERRUPT for flags.

When I try using the module, NULL is returned. There is no error thrown and no reason given, but I do not get a dma_async_tx_descriptor. What should I do to debug this problem?


dma, kernel module

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] unknown symbol of function built into kernel. dbrazeau Linux - Kernel 1 10-30-2013 04:55 PM
[SOLVED] mounting a scsi disk fails with unknown filesystem error Greebstreebling Linux - Hardware 12 03-29-2013 04:18 PM
FTP client fails - error says 500 Unknown user tasdca Linux - Server 1 01-30-2013 12:21 PM
gcov produces unknown function followed by .gcda corrupted file. scrier Programming 6 01-04-2011 02:42 PM
unknown C++ function declaration syntax kpachopoulos Programming 1 08-29-2007 04:43 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration