Unable to correctly mmap DMA buffer in user space.

view full story

http://www.linuxquestions.org – I have developed a driver for a PCI Express card which we also developed. The driver allocates a 16kB DMA buffer using pci_alloc_consistent() which the user space application will mmap(). The problem is the virtual address returned by mmap() in user space cannot seem to access the memory buffer. I test it by writing a known value to the user virtual address. I then have an ioctl() call to the driver which will read the same location from the DMA buffer. This ioctl() call is always reading 0, so the write never shows up in the DMA buffer. Is this a possible memory cacheing or memory alignment (HowTos)