Lines Matching refs:cb_args
184 struct hl_cb_mmap_mem_alloc_args *cb_args = args; in hl_cb_mmap_mem_alloc() local
186 int rc, ctx_id = cb_args->ctx->asid; in hl_cb_mmap_mem_alloc()
189 if (!cb_args->internal_cb) { in hl_cb_mmap_mem_alloc()
191 if (cb_args->cb_size < PAGE_SIZE) in hl_cb_mmap_mem_alloc()
192 cb_args->cb_size = PAGE_SIZE; in hl_cb_mmap_mem_alloc()
195 cb_args->cb_size <= cb_args->hdev->asic_prop.cb_pool_cb_size) { in hl_cb_mmap_mem_alloc()
197 spin_lock(&cb_args->hdev->cb_pool_lock); in hl_cb_mmap_mem_alloc()
198 if (!list_empty(&cb_args->hdev->cb_pool)) { in hl_cb_mmap_mem_alloc()
199 cb = list_first_entry(&cb_args->hdev->cb_pool, in hl_cb_mmap_mem_alloc()
202 spin_unlock(&cb_args->hdev->cb_pool_lock); in hl_cb_mmap_mem_alloc()
205 spin_unlock(&cb_args->hdev->cb_pool_lock); in hl_cb_mmap_mem_alloc()
206 dev_dbg(cb_args->hdev->dev, "CB pool is empty\n"); in hl_cb_mmap_mem_alloc()
212 cb = hl_cb_alloc(cb_args->hdev, cb_args->cb_size, ctx_id, cb_args->internal_cb); in hl_cb_mmap_mem_alloc()
217 cb->hdev = cb_args->hdev; in hl_cb_mmap_mem_alloc()
218 cb->ctx = cb_args->ctx; in hl_cb_mmap_mem_alloc()
225 if (cb_args->map_cb) { in hl_cb_mmap_mem_alloc()
227 dev_err(cb_args->hdev->dev, in hl_cb_mmap_mem_alloc()
233 rc = cb_map_mem(cb_args->ctx, cb); in hl_cb_mmap_mem_alloc()
244 cb_do_release(cb_args->hdev, cb); in hl_cb_mmap_mem_alloc()