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.

use of kmalloc for dma memories

Hi,

Davinci DM6467 has ARM9 core and as far as i know it is a non coherent architecture ie the caches do not get updated when the main memory  gets writeen to by some external peripheral like DMA etc.

But when I am looking into the TSIF driver code I coud see  kmalloc is being used to  allocate memory for PMT and PAT buffers and the corresponding physical address is passed to the TSIF peripheral.

But since kmalloc does not allocate non caceable memory then is it not possible that when the TSIF driver has writtem to the above mentioned buffers it may not be correctly read in the driver code?

Also would it noe be possible that the memory would get swapped out?

Wouldnt using dma_alloc_coherent be a better idea?

 

Regards

Mohammed Anwar

  • Here is the repsone from S/W team:

    Yes, kmalloc for PAT and PMT are called with GFP_KERNEL which does not take care of cache issues. One option would be try with “GFP_DMA | GFP_KERNEL” instead of calling only GFP_KERNEL or using dma_alloc_coherent.

    About your query about swap, Kernel memory does not get swapped out.

    Regards, Srirami.