This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5728: The data read by the upper layer is inconsistent with the kernel

Part Number: AM5728
Other Parts Discussed in Thread: AM4378

Hi team,

Here's an issue from the customer may need your help:

Linux version: linux 4.9.69

Step: The kernel driver requests memory through DMA_alloc_coherent, then moves the gpmc data through DMA into the requested memory, sends the physical address via netlink to the upper-layer application, which then reads the data after the address map. 

Result: The data read by the upper layer is inconsistent with the kernel. (The kernel saves the address data sent to a file, and the upper-layer application saves the data to a file, compare both files) 

The kernel driver requests memory through DMA_alloc_coherent, then moves the gpmc data to the requested memory via DMA, block an address in zmalloc, and convert it to a physical address via virt_to_phys. The DMA is then moved to the data in memory memcpy to the new zmalloc address and the address is sent to the upper-layer application, resulting in the same data.

Compare the two files with errors and find the error here is the previous data. The customer currently suspects that the upper-layer application is reading the data and the data from cache is not flushed into memory.

The same operation is working good on am4378, but the Linux version on 4378 is 4.1.18.

Could you help check this case? Thanks.

Best Regards,

Cherry