I have a PCI device, its Linux driver, and a user-space application. The application mmap's the first BAR of the PCI device through the driver. All the access are done through 32-bits integers, and this is important since reading/writing to a register may have side effects (starting an operation etc.).
On x86 platforms, this works very well. However, I just moved to an ARM platform, and I have a strange behaviour :
- Reads/Writes from the driver behave correctly
- Reads from the user-space triggers a 64 bytes PCI read request, which cannot be fulfilled by my device since it accepts only 32-bits accesses (+ I don't want that because of side effects).
I think the problem is that the mmap wants to prefetch some data and issues this 64 bytes read. Am I missing a flag or something that could disable some sort of mmap prefetching ?
My current mmap implementation on the driver's side is simply
vma->vm_flags |= VM_RESERVED;
remap_pfn_range(vma,vma->vm_start, pfn, Size_UL, vma->vm_page_prot)