I use __dma_free_remap() to unmap this area that come from dma_alloc_coherent().
According to your suggestion, i don't do map in __alloc_from_contiguous() , the test looks all right, i still need to do more tests, it takes about two days.
If the test can pass, may i submit the code to your kernel?
δΊ 2014/5/12 19:24, Arnd Bergmann ει:
On Monday 12 May 2014 18:47:52 albuer wrote:
After I alloc the memory from CMA, i unmap it immediately, ensure the vmalloc area has enough place.
This memory is use for GPU/VPU/Camera etc. Not for ARM.
I have seen some information about CMA: "implement support for contiguous memory areas that are placed in HIGHMEM zone"
I see now that there is some level of support for it, at least the current version of __alloc_from_contiguous() checks for PageHighMem.
However, unmapping an area you got from dma_alloc_coherent() sounds like a really bad idea, that could screw up the memory management in all sorts of ways. What interface do you use to unmap it?
I suppose what you want here would be add a check for DMA_ATTR_NO_KERNEL_MAPPING in alloc_from_contiguous and then just unmap the pages there, rather than calling __dma_remap() or __dma_alloc_remap().
Arnd