Linux DMA from User Space Bus Error

1.6k views Asked by At

i'm following this framework https://forums.xilinx.com/xlnx/attachments/xlnx/ELINUX/10693/1/Linux%20DMA%20from%20User%20Space-public.pdf to perform a data transmission using a DMA. I'm using AXI DMA without scatter gather, with the transmit stream looped back to the receive stream. The codes i am using are the following:dma_proxy.c, dma_proxy.h, dma_proxy_test.c. I have trying to change the u32 for u64 as i'm worknig in a 64bits system. The dma_proxy kernel module works correctly and performs the INTERNAL_TEST correctly, but when i try to read/write on the dma buffers after mapping them on the user application i get this error:

DMA proxy test
[  397.889331] Unhandled fault: level 3 address size fault (0x92000043) at 0x0000007f94d4b004
Bus error

In addtition according to the framework i should watch the DMA buffers on Kernel Mapping Area when i export kernel pagetable, but i get it on vmalloc() Area :

0xffffff80012c5000-0xffffff80012cd000          32K     RW NX SHD AF            UXN MEM/NORMAL-NC
0xffffff80012ce000-0xffffff80015cf000        3076K     RW NX SHD AF            UXN MEM/NORMAL-NC
0xffffff80015d0000-0xffffff80015d8000          32K     RW NX SHD AF            UXN MEM/NORMAL-NC
0xffffff80015d9000-0xffffff80018da000        3076K     RW NX SHD AF            UXN MEM/NORMAL-NC

The files are from this post : https://forums.xilinx.com/t5/Embedded-Linux/BRAM-DMA-transfer-limitation/m-p/555953#M11603 I'm running on a zcu102 evaluation board from Xilinx (Zynq Ultrascale+).

Any idea??

1

There are 1 answers

0
eps_712 On

I have resolve my problem with help from Xilinx Suppornt. It’s the driver code mmap function which make use of dma_common_mmap rather than dma_mmap_coherent, which is the one that should be used to mmap the memory areas allocated by the dmam_alloc_coherent.