Lines Matching defs:dma_pool
85 static int atomic_pool_expand(struct dma_gen_pool *dma_pool, size_t pool_size,
113 if (dma_pool->cc_shared) {
128 if (dma_pool->cc_shared)
142 ret = gen_pool_add_virt(dma_pool->pool, (unsigned long)addr,
155 if (dma_pool->cc_shared &&
166 static void atomic_pool_resize(struct dma_gen_pool *dma_pool, gfp_t gfp)
168 if (dma_pool->pool && gen_pool_avail(dma_pool->pool) < atomic_pool_size)
169 atomic_pool_expand(dma_pool, gen_pool_size(dma_pool->pool), gfp);
183 static __init struct dma_gen_pool *__dma_atomic_pool_init(struct dma_gen_pool *dma_pool,
188 dma_pool->pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE);
189 if (!dma_pool->pool)
192 gen_pool_set_algo(dma_pool->pool, gen_pool_first_fit_order_align, NULL);
196 dma_pool->cc_shared = true;
198 dma_pool->cc_shared = false;
200 ret = atomic_pool_expand(dma_pool, pool_size, gfp);
202 gen_pool_destroy(dma_pool->pool);
203 dma_pool->pool = NULL;
210 gen_pool_size(dma_pool->pool) >> 10, &gfp);
211 return dma_pool;
331 struct dma_gen_pool *dma_pool = NULL;
335 while ((dma_pool = dma_guess_pool(dma_pool, gfp))) {
337 if (dma_pool->cc_shared != !!(attrs & __DMA_ATTR_ALLOC_CC_SHARED))
341 page = __dma_alloc_from_pool(dev, size, dma_pool->pool, cpu_addr,
356 struct dma_gen_pool *dma_pool = NULL;
358 while ((dma_pool = dma_guess_pool(dma_pool, 0))) {
360 if (!gen_pool_has_addr(dma_pool->pool, (unsigned long)start, size))
363 gen_pool_free(dma_pool->pool, (unsigned long)start, size);
395 static bool dma_free_from_pool_phys(struct dma_gen_pool *dma_pool, phys_addr_t phys,
403 gen_pool_for_each_chunk(dma_pool->pool, dma_pool_find_phys, &match);
407 gen_pool_free(dma_pool->pool, match.addr, size);
417 struct dma_gen_pool *dma_pool = NULL;
423 while ((dma_pool = dma_guess_pool(dma_pool, 0))) {
424 if (dma_free_from_pool_phys(dma_pool, phys, size))