summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorTomer Tayar <ttayar@habana.ai>2021-06-10 20:48:39 +0300
committerOded Gabbay <ogabbay@kernel.org>2021-06-18 15:23:42 +0300
commitf5d6e39eb2a933a1734cd8a620c8bcd52c4a0947 (patch)
tree8a37972b823281b83ac96f79835ea53d367c5a1b /drivers/misc
parent3002f467a0b0a70aec01d9f446da4ac8c6fda10b (diff)
downloadlwn-f5d6e39eb2a933a1734cd8a620c8bcd52c4a0947.tar.gz
lwn-f5d6e39eb2a933a1734cd8a620c8bcd52c4a0947.zip
habanalabs: print more info when failing to pin user memory
pin_user_pages_fast() might fail and return a negative number, or pin less pages than requested and return the number of the pages that were pinned. For the latter, it is informative to print also the memory size and the number of requested pages. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/habanalabs/common/memory.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/habanalabs/common/memory.c b/drivers/misc/habanalabs/common/memory.c
index a7a8984e6af2..1cff1887e2e8 100644
--- a/drivers/misc/habanalabs/common/memory.c
+++ b/drivers/misc/habanalabs/common/memory.c
@@ -1612,8 +1612,8 @@ static int get_user_memory(struct hl_device *hdev, u64 addr, u64 size,
if (rc != npages) {
dev_err(hdev->dev,
- "Failed (%d) to pin host memory with user ptr 0x%llx\n",
- rc, addr);
+ "Failed (%d) to pin host memory with user ptr 0x%llx, size 0x%llx, npages %d\n",
+ rc, addr, size, npages);
if (rc < 0)
goto destroy_pages;
npages = rc;