07-12-2010 01:22 AM
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
07-12-2010 10:22 AM
07-13-2010 05:34 AM
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