I’m having trouble with a iarge DMA allocation I have to do in my driver. As part of a video driver, I need to allocate a few 4Meg regions. The first works fine, but the rest fail.
I tried editing my .config to raise the CONFIG_FORCE_MAX_ZONEORDER to 12, but that didn’t seem to help much.
Hard to say anything without knowing how “fail” is determined. I assume there was some sort of allocation in a kernel module (not userspace?) which returned something for failure? What was the function call and what was the return?
have you tried to increase the CMA area size? i.e. increase CONFIG_CMA_SIZE_MBYTES to e.g. 32,
and maybe increase CONFIG_CMA_AREAS by one so you can have your own.
as far as I understand the ARM dma_alloc_coherent logic, it first tries to satisfy this request
from the CMA areas IF they exist and if they have enough space. If not, it tries the “standard”
way which will almost always fail with megabyte-sized blocks when userspace is up.
I solved similar problems passing the parameters “vmalloc=512M cma=64M coherent_pool=32M” to kernel. I’m not sure if that is the correct/best way to do it though.