Lines Matching refs:pool
79 static int atomic_pool_expand(struct gen_pool *pool, size_t pool_size, in atomic_pool_expand() argument
120 ret = gen_pool_add_virt(pool, (unsigned long)addr, page_to_phys(page), in atomic_pool_expand()
145 static void atomic_pool_resize(struct gen_pool *pool, gfp_t gfp) in atomic_pool_resize() argument
147 if (pool && gen_pool_avail(pool) < atomic_pool_size) in atomic_pool_resize()
148 atomic_pool_expand(pool, gen_pool_size(pool), gfp); in atomic_pool_resize()
165 struct gen_pool *pool; in __dma_atomic_pool_init() local
168 pool = gen_pool_create(PAGE_SHIFT, NUMA_NO_NODE); in __dma_atomic_pool_init()
169 if (!pool) in __dma_atomic_pool_init()
172 gen_pool_set_algo(pool, gen_pool_first_fit_order_align, NULL); in __dma_atomic_pool_init()
174 ret = atomic_pool_expand(pool, pool_size, gfp); in __dma_atomic_pool_init()
176 gen_pool_destroy(pool); in __dma_atomic_pool_init()
183 gen_pool_size(pool) >> 10, &gfp); in __dma_atomic_pool_init()
184 return pool; in __dma_atomic_pool_init()
241 struct gen_pool *pool, void **cpu_addr, in __dma_alloc_from_pool() argument
247 addr = gen_pool_alloc(pool, size); in __dma_alloc_from_pool()
251 phys = gen_pool_virt_to_phys(pool, addr); in __dma_alloc_from_pool()
253 gen_pool_free(pool, addr, size); in __dma_alloc_from_pool()
257 if (gen_pool_avail(pool) < atomic_pool_size) in __dma_alloc_from_pool()
269 struct gen_pool *pool = NULL; in dma_alloc_from_pool() local
272 while ((pool = dma_guess_pool(pool, gfp))) { in dma_alloc_from_pool()
273 page = __dma_alloc_from_pool(dev, size, pool, cpu_addr, in dma_alloc_from_pool()
285 struct gen_pool *pool = NULL; in dma_free_from_pool() local
287 while ((pool = dma_guess_pool(pool, 0))) { in dma_free_from_pool()
288 if (!gen_pool_has_addr(pool, (unsigned long)start, size)) in dma_free_from_pool()
290 gen_pool_free(pool, (unsigned long)start, size); in dma_free_from_pool()