cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Explorer
Explorer
3,845 Views
Registered: ‎10-01-2008

dma_map_single() returning 0

Hi,

 

I am writing a driver that is similar to xapp1129 (there are some differences, for example, it doesn't use buffer descriptor for DMA operation). Similar to the xapp1129 design, in my write () function, I allocated a new block of memory through kmalloc () and pass the returned virtual address to dma_map_single() to get the physical address. But in my desgin, the dma_map_single is returning 0.

 

I have searched google on this, but didn't find out much useful info about my problem. I wonder if anyone here has experienced a similar problem like mine and has a solution for it.

 

Thanks,

Yan Shun Li

0 Kudos
Reply
2 Replies
Anonymous
Not applicable
3,832 Views

0 Kudos
Reply
Explorer
Explorer
3,820 Views
Registered: ‎10-01-2008

Hi,

 

Thanks! But actually I have solved that one before already. That was more a problem with booting the kernel. But in my case, the kernel boots up fine, but just at the run time, dma_map_single() is returning 0 when I write to the driver.

 

My code has been extremely similar to the way xapp1129 is written - kamlloc in write()/read() and dma_map_single() in another function called by write/read. So I am really puzzled by the result I am getting. And based on my search on google, it just look like not many people are coming across the problem I am seeing.

 

Any other idea?

 

Thanks a bunch,

Yan

0 Kudos
Reply