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.

SK-AM69: Memory corruption on dma_alloc_attrs() allocated memories.

Part Number: SK-AM69

Tool/software:

Hi,

I'm working on project that requires memory allocation for DMA.
While working on it, It seems like there is memory corruption on allocated memories.

So we made programs to test this.

dma_bridge.tar.gz

Each program operates as follows

- Kernel module

1. Allocate memory when ioctl(DMA_BRIDGE_ALLOC) is given.
2. Print memories when ioctl is given.

- Userspace application

1. Request allocation to kernel module with ioctl(DMA_BRIDGE_ALLOC).
2. Write magic value (0xbeef0000) into allocated memories through mmap() function.
3. Print memories on userspace and request kernel module to dump using ioctl(DMA_BRIDGE_DATA_DUMP_IN_KERNEL).

The execution results and the problem description are as follows.

Problem #1 - Memory dump on device driver shows all zero. Which should be the magic number.
Problem #2 - Memory dump on userspace sometimes shows zero. Which should be the magic number.

This problem is only showed up on SK-AM69.
I've already tested this code on other ARM board and X86 machine.

If I use dma_alloc_coherent() for allocation, the result was same.

Regards,

Minsoo