Skip to content

Commit c9f9d0e

Browse files
dlibemanogabbay
authored andcommitted
accel/habanalabs: print error code when mapping fails
Failure to map is considered a non-trivial error and we need to notify the user about it. Signed-off-by: Dani Liberman <dliberman@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
1 parent ae303d8 commit c9f9d0e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/accel/habanalabs/common/memory.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -955,8 +955,8 @@ static int map_phys_pg_pack(struct hl_ctx *ctx, u64 vaddr,
955955
(i + 1) == phys_pg_pack->npages);
956956
if (rc) {
957957
dev_err(hdev->dev,
958-
"map failed for handle %u, npages: %llu, mapped: %llu",
959-
phys_pg_pack->handle, phys_pg_pack->npages,
958+
"map failed (%d) for handle %u, npages: %llu, mapped: %llu\n",
959+
rc, phys_pg_pack->handle, phys_pg_pack->npages,
960960
mapped_pg_cnt);
961961
goto err;
962962
}
@@ -1186,7 +1186,8 @@ static int map_device_va(struct hl_ctx *ctx, struct hl_mem_in *args, u64 *device
11861186

11871187
rc = map_phys_pg_pack(ctx, ret_vaddr, phys_pg_pack);
11881188
if (rc) {
1189-
dev_err(hdev->dev, "mapping page pack failed for handle %u\n", handle);
1189+
dev_err(hdev->dev, "mapping page pack failed (%d) for handle %u\n",
1190+
rc, handle);
11901191
mutex_unlock(&hdev->mmu_lock);
11911192
goto map_err;
11921193
}

0 commit comments

Comments
 (0)