Lines Matching defs:handle
46 * @ret_handle : result handle
50 * - Return unique handle
60 int handle, rc;
126 handle = idr_alloc(&vm->phys_pg_pack_handles, phys_pg_pack, 1, 0,
130 if (handle < 0) {
131 dev_err(hdev->dev, "Failed to get handle for page\n");
139 phys_pg_pack->handle = handle;
144 *ret_handle = handle;
300 * @handle : handle of the memory chunk to free
303 * - Free the device memory related to the given handle
305 static int free_device_memory(struct hl_ctx *ctx, u32 handle)
312 phys_pg_pack = idr_find(&vm->phys_pg_pack_handles, handle);
315 dev_err(hdev->dev, "handle %u is mapped, cannot free\n",
316 handle);
326 idr_remove(&vm->phys_pg_pack_handles, handle);
336 "free device memory failed, no match for handle %u\n",
337 handle);
749 "map failed for handle %u, npages: %llu, mapped: %llu",
750 phys_pg_pack->handle, phys_pg_pack->npages,
767 "failed to unmap handle %u, va: 0x%llx, pa: 0x%llx, page size: %u\n",
768 phys_pg_pack->handle, next_vaddr,
814 u32 handle;
816 handle = lower_32_bits(args->map_device.handle);
818 phys_pg_pack = idr_find(&vm->phys_pg_pack_handles, handle);
821 dev_err(hdev->dev, "no match for handle %u\n", handle);
836 * @args : host parameters with handle/host virtual address
840 * - If given a physical device memory handle, map to a device virtual block
857 u32 handle = 0, va_block_align;
887 handle = phys_pg_pack->handle;
910 handle = lower_32_bits(args->map_device.handle);
913 phys_pg_pack = idr_find(&vm->phys_pg_pack_handles, handle);
917 "no match for handle %u\n", handle);
942 "Failed to map memory, handle %u is not shared\n",
943 handle);
957 dev_err(hdev->dev, "no available va block for handle %u\n",
958 handle);
968 dev_err(hdev->dev, "mapping page pack failed for handle %u\n",
969 handle);
979 "mapping handle %u failed due to MMU cache invalidation\n",
980 handle);
1004 "release va block failed for handle 0x%x, vaddr: 0x%llx\n",
1005 handle, ret_vaddr);
1165 u32 handle = 0;
1181 rc = alloc_device_memory(ctx, &args->in, &handle);
1184 args->out.handle = (__u64) handle;
1188 rc = free_device_memory(ctx, args->in.free.handle);
1224 u32 handle = 0;
1251 rc = alloc_device_memory(ctx, &args->in, &handle);
1254 args->out.handle = (__u64) handle;
1258 rc = free_device_memory(ctx, args->in.free.handle);
1687 * address of the memory related to the given handle.