diff options
author | Omer Shpigelman <oshpigelman@habana.ai> | 2019-02-28 11:46:16 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-02-28 15:04:59 +0300 |
commit | 3dccd18787b84d111133794c8076c69e8fb6d84e (patch) | |
tree | a7548be5027324ac5b75c7eea195de5e015aba6b /drivers/misc | |
parent | 887f7d38e4b0d0d2405eb835b914c22c9390dc7e (diff) | |
download | linux-3dccd18787b84d111133794c8076c69e8fb6d84e.tar.xz |
habanalabs: extend QMAN0 job timeout
This patch fix a bug where the timeout for sending a job on QMAN0 by KMD
wasn't enough in palladium environment.
Signed-off-by: Omer Shpigelman <oshpigelman@habana.ai>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/habanalabs/goya/goya.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c index 578e4bdc3a49..13923f4127af 100644 --- a/drivers/misc/habanalabs/goya/goya.c +++ b/drivers/misc/habanalabs/goya/goya.c @@ -83,6 +83,7 @@ #define GOYA_CPU_TIMEOUT_USEC 10000000 /* 10s */ #define GOYA_TEST_QUEUE_WAIT_USEC 100000 /* 100ms */ #define GOYA_PLDM_MMU_TIMEOUT_USEC (MMU_CONFIG_TIMEOUT_USEC * 100) +#define GOYA_PLDM_QMAN0_TIMEOUT_USEC (HL_DEVICE_TIMEOUT_USEC * 30) #define GOYA_QMAN0_FENCE_VAL 0xD169B243 @@ -3126,9 +3127,14 @@ static int goya_send_job_on_qman0(struct hl_device *hdev, struct hl_cs_job *job) u32 *fence_ptr; dma_addr_t fence_dma_addr; struct hl_cb *cb; - u32 tmp; + u32 tmp, timeout; int rc; + if (hdev->pldm) + timeout = GOYA_PLDM_QMAN0_TIMEOUT_USEC; + else + timeout = HL_DEVICE_TIMEOUT_USEC; + if (!hdev->asic_funcs->is_device_idle(hdev)) { dev_err_ratelimited(hdev->dev, "Can't send KMD job on QMAN0 if device is not idle\n"); @@ -3175,8 +3181,8 @@ static int goya_send_job_on_qman0(struct hl_device *hdev, struct hl_cs_job *job) goto free_fence_ptr; } - rc = hl_poll_timeout_memory(hdev, (u64) (uintptr_t) fence_ptr, - HL_DEVICE_TIMEOUT_USEC, &tmp); + rc = hl_poll_timeout_memory(hdev, (u64) (uintptr_t) fence_ptr, timeout, + &tmp); hl_hw_queue_inc_ci_kernel(hdev, GOYA_QUEUE_ID_DMA_0); |