All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oded Gabbay <oded.gabbay@gmail.com>
To: linux-kernel@vger.kernel.org, SW_Drivers@habana.ai
Subject: [PATCH 7/9] habanalabs: check TPC vector pipe is empty
Date: Sat, 15 Aug 2020 20:59:36 +0300	[thread overview]
Message-ID: <20200815175938.16619-7-oded.gabbay@gmail.com> (raw)
In-Reply-To: <20200815175938.16619-1-oded.gabbay@gmail.com>

The driver waits for the TPC vector pipe to be empty before checking if the
TPC kernel has finished executing, but the code doesn't validate that the
pipe was indeed empty, it just wait for it without checking the return
value.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
---
 drivers/misc/habanalabs/gaudi/gaudi.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c
index ffd0849e8f2d..3360c3c207a9 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -6262,6 +6262,15 @@ static int gaudi_run_tpc_kernel(struct hl_device *hdev, u64 tpc_kernel,
 		1000,
 		kernel_timeout);
 
+	if (rc) {
+		dev_err(hdev->dev,
+			"Timeout while waiting for TPC%d vector pipe\n",
+			tpc_id);
+		hdev->asic_funcs->set_clock_gating(hdev);
+		mutex_unlock(&gaudi->clk_gate_mutex);
+		return -EIO;
+	}
+
 	rc = hl_poll_timeout(
 		hdev,
 		mmTPC0_CFG_WQ_INFLIGHT_CNTR + offset,
-- 
2.17.1


  parent reply	other threads:[~2020-08-15 22:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-15 17:59 [PATCH 1/9] habanalabs: change CB's ID to be 64 bits Oded Gabbay
2020-08-15 17:59 ` [PATCH 2/9] habanalabs: cast int to u32 before printing it with %u Oded Gabbay
2020-08-16 15:24   ` Tomer Tayar
2020-08-15 17:59 ` [PATCH 3/9] habanalabs: eliminate redundant else condition Oded Gabbay
2020-08-16 15:24   ` Tomer Tayar
2020-08-15 17:59 ` [PATCH 4/9] habanalabs: use standard BIT() and GENMASK() Oded Gabbay
2020-08-16 15:24   ` Tomer Tayar
2020-08-15 17:59 ` [PATCH 5/9] habanalabs: use FIELD_PREP() instead of << Oded Gabbay
2020-08-16 15:24   ` Tomer Tayar
2020-08-15 17:59 ` [PATCH 6/9] habanalabs: remove redundant assignment to variable Oded Gabbay
2020-08-16 15:24   ` Tomer Tayar
2020-08-15 17:59 ` Oded Gabbay [this message]
2020-08-16 15:24   ` [PATCH 7/9] habanalabs: check TPC vector pipe is empty Tomer Tayar
2020-08-15 17:59 ` [PATCH 9/9] habanalabs: extend busy engines mask to 64 bits Oded Gabbay
2020-08-16 15:24 ` [PATCH 1/9] habanalabs: change CB's ID to be " Tomer Tayar
     [not found] ` <20200815175938.16619-8-oded.gabbay@gmail.com>
2020-08-16 15:24   ` [PATCH 8/9] habanalabs: use 1U when shifting bits Tomer Tayar

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=20200815175938.16619-7-oded.gabbay@gmail.com \
    --to=oded.gabbay@gmail.com \
    --cc=SW_Drivers@habana.ai \
    --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.