All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oded Gabbay <ogabbay@kernel.org>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] habanalabs: better error print for pin failure
Date: Sun,  2 May 2021 18:51:39 +0300	[thread overview]
Message-ID: <20210502155140.4359-3-ogabbay@kernel.org> (raw)
In-Reply-To: <20210502155140.4359-1-ogabbay@kernel.org>

Print the user given pointer and error code on failure to get user
pages for easier debugging.

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
---
 drivers/misc/habanalabs/common/memory.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/misc/habanalabs/common/memory.c b/drivers/misc/habanalabs/common/memory.c
index 43924e1c0315..a7a8984e6af2 100644
--- a/drivers/misc/habanalabs/common/memory.c
+++ b/drivers/misc/habanalabs/common/memory.c
@@ -1612,7 +1612,8 @@ static int get_user_memory(struct hl_device *hdev, u64 addr, u64 size,
 
 	if (rc != npages) {
 		dev_err(hdev->dev,
-			"Failed to map host memory, user ptr probably wrong\n");
+			"Failed (%d) to pin host memory with user ptr 0x%llx\n",
+			rc, addr);
 		if (rc < 0)
 			goto destroy_pages;
 		npages = rc;
-- 
2.25.1


  parent reply	other threads:[~2021-05-02 15:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-02 15:51 [PATCH 1/4] habanalabs: ignore device unusable status Oded Gabbay
2021-05-02 15:51 ` [PATCH 2/4] habanalabs: add missing space after casting Oded Gabbay
2021-05-02 15:51 ` Oded Gabbay [this message]
2021-05-02 15:51 ` [PATCH 4/4] habanalabs: set dma mask from fw once fw done iatu config Oded Gabbay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210502155140.4359-3-ogabbay@kernel.org \
    --to=ogabbay@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.