Lines Matching refs:handle

27 			struct hl_mem_in *args, u64 *handle);
81 * @ret_handle: result handle.
85 * - Return unique handle for later map/unmap/free.
96 int handle, rc;
174 handle = idr_alloc(&vm->phys_pg_pack_handles, phys_pg_pack, 1, 0,
178 if (handle < 0) {
179 dev_err(hdev->dev, "Failed to get handle for page\n");
187 phys_pg_pack->handle = handle;
192 *ret_handle = handle;
351 * - Free the device memory related to the given handle.
358 u32 handle = args->free.handle;
361 phys_pg_pack = idr_find(&vm->phys_pg_pack_handles, handle);
364 dev_err(hdev->dev, "free device memory failed, no match for handle %u\n", handle);
370 dev_err(hdev->dev, "handle %u is mapped, cannot free\n", handle);
377 idr_remove(&vm->phys_pg_pack_handles, handle);
958 "map failed (%d) for handle %u, npages: %llu, mapped: %llu\n",
959 rc, phys_pg_pack->handle, phys_pg_pack->npages,
978 "failed to unmap handle %u, va: 0x%llx, pa: 0x%llx, page size: %u\n",
979 phys_pg_pack->handle, next_vaddr,
1039 * @args: host parameters with handle/host virtual address.
1043 * - If given a physical device memory handle, map to a device virtual block
1055 u32 handle = 0, va_block_align;
1092 handle = phys_pg_pack->handle;
1116 handle = lower_32_bits(args->map_device.handle);
1119 phys_pg_pack = idr_find(&vm->phys_pg_pack_handles, handle);
1123 "no match for handle %u\n", handle);
1149 "Failed to map memory, handle %u is not shared\n",
1150 handle);
1179 dev_err(hdev->dev, "no available va block for handle %u\n",
1180 handle);
1189 dev_err(hdev->dev, "mapping page pack failed (%d) for handle %u\n",
1190 rc, handle);
1216 hnode->handle = is_userptr ? MEM_HANDLE_INVALID : handle;
1233 "release va block failed for handle 0x%x, vaddr: 0x%llx\n",
1234 handle, ret_vaddr);
1408 static int map_block(struct hl_device *hdev, u64 address, u64 *handle, u32 *size)
1413 *handle = 0;
1421 *handle = block_id | HL_MMAP_TYPE_BLOCK;
1422 *handle <<= PAGE_SHIFT;
1794 /* get the memory handle */
1803 if (upper_32_bits(hnode->handle)) {
1805 dev_dbg(hdev->dev, "invalid handle %#llx for map address %#llx\n",
1806 hnode->handle, addr);
2001 phys_pg_pack = idr_find(&vm->phys_pg_pack_handles, (u32) hnode->handle);
2004 dev_dbg(hdev->dev, "no match for handle 0x%x\n", (u32) hnode->handle);
2011 dev_dbg(hdev->dev, "handle 0x%llx does not represent DRAM memory\n", hnode->handle);
2176 * @handle: user timestamp buffer handle as an output
2178 static int allocate_timestamps_buffers(struct hl_fpriv *hpriv, struct hl_mem_in *args, u64 *handle)
2193 *handle = buf->handle;
2206 u32 handle = 0, block_size;
2226 * handle the allocation/freeing of that memory. However, for
2243 args->out.handle = 0;
2247 rc = alloc_device_memory(ctx, &args->in, &handle);
2250 args->out.handle = (__u64) handle;
2255 * handle the allocation/freeing of that memory. However, for
2307 rc = allocate_timestamps_buffers(hpriv, &args->in, &args->out.handle);
2711 * address of the memory related to the given handle.