Something went wrong on our end
Select Git revision
firmware_class.c
-
Taniya Das authored
Peripheral loader requesting for dma allocation could have regions which are either carveout or cma region. In case of a carveout which could be large area, the allocation could fail due to constraints of vmalloc space. To avoid allocation failure, set the dma attribute to NO_KERNEL_MAPPING for all requested allocations. When NO_KERNEL_MAPPING is set as an attribute, dma allocation for carveout will return a dummy allocated address and for a cma region a valid address will be returned, but the kernel mapping for that address will not exist. When peripheral loader requires the firmware data to be copied or the address region to be zeroed-out, it will perform: map_fw_mem will invoke dma_remap api which will take care of - ioremap the address for carveout and provide a valid virtual address for a requested size. - remap the address, update the kernel mapping for cma regions and provide a valid virtual address for a requested size. unmap_fw_mem will invoke dma_unremap api will take care of - iounmap the address for carveout regions for a requested size. - remove the kernel mapping for requested size. Pass the buffer size from firmware driver to peripheral loader for dma_unremap. Change-Id: Ic1feecbd604008da62ef7a84b07ab8cad2baee94 Signed-off-by:
Taniya Das <tdas@codeaurora.org>
Taniya Das authoredPeripheral loader requesting for dma allocation could have regions which are either carveout or cma region. In case of a carveout which could be large area, the allocation could fail due to constraints of vmalloc space. To avoid allocation failure, set the dma attribute to NO_KERNEL_MAPPING for all requested allocations. When NO_KERNEL_MAPPING is set as an attribute, dma allocation for carveout will return a dummy allocated address and for a cma region a valid address will be returned, but the kernel mapping for that address will not exist. When peripheral loader requires the firmware data to be copied or the address region to be zeroed-out, it will perform: map_fw_mem will invoke dma_remap api which will take care of - ioremap the address for carveout and provide a valid virtual address for a requested size. - remap the address, update the kernel mapping for cma regions and provide a valid virtual address for a requested size. unmap_fw_mem will invoke dma_unremap api will take care of - iounmap the address for carveout regions for a requested size. - remove the kernel mapping for requested size. Pass the buffer size from firmware driver to peripheral loader for dma_unremap. Change-Id: Ic1feecbd604008da62ef7a84b07ab8cad2baee94 Signed-off-by:
Taniya Das <tdas@codeaurora.org>
firmware_class.c 42.31 KiB