LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   alloc_bootmem_low_pages & pci_map_single ? (https://www.linuxquestions.org/questions/linux-kernel-70/alloc_bootmem_low_pages-and-pci_map_single-708030/)

marc_ba 02-27-2009 11:40 AM

alloc_bootmem_low_pages & pci_map_single ?
 
Dear all,

I implement a PCIe device driver that needs a huge amount of contiguous (dma-capable) memory.

1. I use alloc_bootmem_low_pages to allocate that memory at boot time; that memory region is mapped to user space thanks to mmap; so far, so good, it works fine.

2. The problem arises when I start to play with DMA ... I just call pci_map_single on the buffer returned by alloc_bootmem_low_pages, and give that address to my device; my device writes at that address. When completed, I receive an IT and calls pci_unmap_single. I then access that memory in user-space.

Problem is: Most of the data is correctly written, but there remains some small areas that are *not* written, leaving bunches of memory garbage in my buffer ... It does not always happen at the same memory address ...

Any clues is warmly welcomed :)

Best regards,

Marc


All times are GMT -5. The time now is 05:54 PM.