For the Jetson TX1 I try to allocate DMA memory for a PCIe Network card and map into user space.
My procedure is working on x86/amd64 and even on L4T 24.1 (Kernel 3.10.96) but not on the latest L4T 28.2 (Kernel 4.4.38).
#Situation
In my mmap function everything seems to work:
In the application I get memory from the mmap-function but it is not the same as in the kernel object.
It’s not memset to zero and the physical address I wrote in first 4 Byte is missing.
When I continue and start using the memory, the Ubuntu freezes and on the screen appears a strange pattern.
#Questions
Is this a Bug or is this caused by the SMMU?
Is there a way to handle this without customizing the Kernel?
Do you have any suggestion how I should proceed?
I can’t tell you how to solve (I haven’t looked at DMA in a long time), but you are probably correct about SMMU involvement. R24.1 was an initial release and was 32-bit user space, but 64-bit kernel space. The DMA address space was by default 32-bit and used physical address directly. After going to 64-bit there were some PCI DMA devices which did not function correctly because they were expecting physical address, but it was really the SMMU they needed to talk to. There are some minor changes to how to request and use the address when the SMMU is involved. Once that is accounted for it should work (but I don’t recall the specific changes for that).