diff options
| author | Oded Gabbay <oded.gabbay@gmail.com> | 2020-08-12 11:28:13 +0300 |
|---|---|---|
| committer | Oded Gabbay <oded.gabbay@gmail.com> | 2020-09-22 18:49:50 +0300 |
| commit | 31ac1f1a5712696c45ea3ebb23e60b4e7e5cb0b6 (patch) | |
| tree | 908b800d19d37a48c1380d0acfdbf8974cc2b4de | |
| parent | habanalabs: remove redundant assignment to variable (diff) | |
| download | linux-31ac1f1a5712696c45ea3ebb23e60b4e7e5cb0b6.tar.gz linux-31ac1f1a5712696c45ea3ebb23e60b4e7e5cb0b6.zip | |
habanalabs: check TPC vector pipe is empty
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>
Reviewed-by: Tomer Tayar <ttayar@habana.ai>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
| -rw-r--r-- | drivers/misc/habanalabs/gaudi/gaudi.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c index 1cf37332a0ff..a0932261e67c 100644 --- a/drivers/misc/habanalabs/gaudi/gaudi.c +++ b/drivers/misc/habanalabs/gaudi/gaudi.c @@ -6304,6 +6304,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, |
