ikwzm / udmabuf

User space mappable dma buffer device driver for Linux.
BSD 2-Clause "Simplified" License
539 stars 165 forks source link

udmabuf write issue from firmware/pci #84

Open njsys opened 2 years ago

njsys commented 2 years ago

we used 4MB udmabuf to read and write from firmware to host(linux) memory successfully on hardware configuration1 for a while. Also we are able to read and write to udmabuf with linux test programs in the host. So both the firmware writes and host writes work.

Now we have new piece of hardware configuration and we are seeing strange/different behavior. In the new hardware we are still able to read and write completely to udmabuf with linux test programs in the host. HOWEVER, the firmware/PCI writes are not working properly with the new hardware. We see that even if we are writing 10000 bytes from firmware, only the last 80 bytes are written to the udmabuf space when we read it on linux host. What happened to the remaining bytes being written from firmware to udmabuf?

Does anyone know what could be going wrong here or any debugging tips? thanks

ikwzm commented 2 years ago

Thank you for the issue.

What CPU are you running u-dma-buf?

u-dma-buf supports cache control only on ARM or ARM64. x86 or amd86 does not support cache control. (Please read the Readme.md)

njsys commented 2 years ago

x86_64

njsys commented 2 years ago

in that case at driver level is it possible to write debug print statements to see what is being received by the kernel and monitor that in dmesg?

ikwzm commented 2 years ago

It's very difficult. It is difficult for the Linux Kernel to detect when a device on the PCI side accesses memory or cache.