I'm currently writing a PCIe kernel driver for linux kernel 4.19.
A FPGA (Arria 10) running an Intel DMA IP is connected to the Linux CPU (i7-6700TE) via PCIe Gen 2.
I want to run an upstream DMA transfer from FPGA to CPU RAM.
First the PCIe driver is initialized. I'm using the following instructions in order:
- pci_enable_device
- pci_set_master
- pci_set_mwi
- pci_set_dma_mask DMA_BIT_MASK(64)
- pci_alloc_consistent
After allocation I push the physical address into the DMA configuration and start the transfer. After finishing I post a MSI, which is received and handeled.
The problem I have is that when reading the DMA data using the virtual address I only read zeros, while not writing any zeros via DMA.
I also tested the memory region by first writing a ramp to memory via CPU, then starting the DMA, then reading again and the ramp remained unchanged, thus I'm quite convinced, that no memory accesses to the specified region happened.
Why does the MSI transfer work (address space CPU), but the RAM access doesn't?
Do you have an idea what to do next?
Thanks in advance for your help.