Cma mem map to cpu address when allocated in ion driver, why do this design?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi  all,

When I review ion code in linux-3.18.y, I find a design that may cause a problem in our product. In the design, cma mem is allocated via the interface of dma_alloc_coherent ,

and this function will create a map to cpu. Sometimes, we just need cma phys addr, do not need cpu address.

In our product, We need to map many discontinuous phy mem in kernel space, and those mem will use much vmalloc area. When cma mem is in highmem, it also need to use vmalloc area when

Allocated, but we just use cma phys addr, the cpu virtual addr is not need. In linux-3.18.y, cma will reserved in high mem zone firstly. If cma mem is allocated more,and more vmalloc area will be used.

This may cause a problem that the vmalloc area will not enough when discontinuous phys mem need to map.

So,  why dose cma mem need to map to cpu address when allocated ?   As mem allocated in system heap, it does not map to cpu address at that time, and we can map it whenever we use it by map_kernel function dynamically.

So,  why cma heap is not designed like system heap?



Best regards,
Wei.Yang

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux