Lines Matching full:cma

11  *   The Contiguous Memory Allocator (CMA) makes it possible to
32 * CMA tries to solve this issue by operating on memory regions
38 #define pr_fmt(fmt) "cma: " fmt
52 #include <linux/cma.h>
60 struct cma *dma_contiguous_default_area;
63 * Default global CMA area size can be defined in kernel's .config.
69 * Users, who want to set the size of global CMA area for their system
70 * should use cma= kernel parameter.
97 early_param("cma", early_cma);
101 static struct cma *dma_contiguous_pernuma_area[MAX_NUMNODES];
141 struct cma **cma = &dma_contiguous_pernuma_area[nid]; in dma_pernuma_cma_reserve() local
145 0, false, name, cma, nid); in dma_pernuma_cma_reserve()
215 * @res_cma: Pointer to store the created cma region.
228 phys_addr_t limit, struct cma **res_cma, in dma_contiguous_reserve_area()
282 static struct page *cma_alloc_aligned(struct cma *cma, size_t size, gfp_t gfp) in cma_alloc_aligned() argument
286 return cma_alloc(cma, size >> PAGE_SHIFT, align, gfp & __GFP_NOWARN); in cma_alloc_aligned()
296 * tries to use per-numa cma, if the allocation fails, it will fallback to
301 * there is no need to waste CMA pages for that kind; it also helps reduce
310 /* CMA can be used only in the context which permits sleeping */ in dma_alloc_contiguous()
320 struct cma *cma = dma_contiguous_pernuma_area[nid]; in dma_alloc_contiguous() local
323 if (cma) { in dma_alloc_contiguous()
324 page = cma_alloc_aligned(cma, size, gfp); in dma_alloc_contiguous()
351 /* if dev has its own cma, free page from there */ in dma_free_contiguous()
357 * otherwise, page is from either per-numa cma or default cma in dma_free_contiguous()
368 /* not in any cma, free from buddy */ in dma_free_contiguous()
403 bool default_cma = of_get_flat_dt_prop(node, "linux,cma-default", NULL); in rmem_cma_setup()
404 struct cma *cma; in rmem_cma_setup() local
408 pr_info("Reserved memory: bypass %s node, using cmdline CMA params instead\n", in rmem_cma_setup()
418 pr_err("Reserved memory: incorrect alignment of CMA region\n"); in rmem_cma_setup()
422 err = cma_init_reserved_mem(rmem->base, rmem->size, 0, rmem->name, &cma); in rmem_cma_setup()
424 pr_err("Reserved memory: unable to setup CMA region\n"); in rmem_cma_setup()
431 dma_contiguous_default_area = cma; in rmem_cma_setup()
434 rmem->priv = cma; in rmem_cma_setup()
436 pr_info("Reserved memory: created CMA memory pool at %pa, size %ld MiB\n", in rmem_cma_setup()
441 RESERVEDMEM_OF_DECLARE(cma, "shared-dma-pool", rmem_cma_setup);