summaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs/habanalabs.h
diff options
context:
space:
mode:
authorDalit Ben Zoor <dbenzoor@habana.ai>2019-04-30 16:18:51 +0200
committerOded Gabbay <oded.gabbay@gmail.com>2019-04-30 16:18:51 +0200
commitb1b537713eb1a63a2ecc3547693b3eef7dfb9281 (patch)
tree6144f7f6cb5e7822006155ab35271eec095c18f5 /drivers/misc/habanalabs/habanalabs.h
parenthabanalabs: remove condition that is always true (diff)
downloadlinux-b1b537713eb1a63a2ecc3547693b3eef7dfb9281.tar.xz
linux-b1b537713eb1a63a2ecc3547693b3eef7dfb9281.zip
habanalabs: increase timeout if working with simulator
Where there is a spike in the CPU consumption, it may cause random failures in the C/I since the KMD timeout for CPU and/or QMAN0 jobs expires and it stops communicating to the simulator. This commit fixes it by increasing timeout on polling functions if working with simulator. Signed-off-by: Dalit Ben Zoor <dbenzoor@habana.ai> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to '')
-rw-r--r--drivers/misc/habanalabs/habanalabs.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/habanalabs.h b/drivers/misc/habanalabs/habanalabs.h
index 0da80e8eab42..71243b319920 100644
--- a/drivers/misc/habanalabs/habanalabs.h
+++ b/drivers/misc/habanalabs/habanalabs.h
@@ -1042,7 +1042,12 @@ void hl_wreg(struct hl_device *hdev, u32 reg, u32 val);
#define hl_poll_timeout(hdev, addr, val, cond, sleep_us, timeout_us) \
({ \
- ktime_t __timeout = ktime_add_us(ktime_get(), timeout_us); \
+ ktime_t __timeout; \
+ /* timeout should be longer when working with simulator */ \
+ if (hdev->pdev) \
+ __timeout = ktime_add_us(ktime_get(), timeout_us); \
+ else \
+ __timeout = ktime_add_us(ktime_get(), (timeout_us * 10)); \
might_sleep_if(sleep_us); \
for (;;) { \
(val) = RREG32(addr); \