summaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs/device.c
diff options
context:
space:
mode:
authorOded Gabbay <oded.gabbay@gmail.com>2019-03-03 15:13:15 +0200
committerOded Gabbay <oded.gabbay@gmail.com>2019-03-03 15:13:15 +0200
commitcbaa99ed1b697072f089693a7fe2d649d08bf317 (patch)
tree0af62e0d486c1aae0539c7d44cc3ddc3bbf26107 /drivers/misc/habanalabs/device.c
parentd12a5e2458d49aad2b7d25766794eec95ae8f6f1 (diff)
downloadlinux-cbaa99ed1b697072f089693a7fe2d649d08bf317.tar.bz2
habanalabs: perform accounting for active CS
This patch adds accounting for active CS. Active means that the CS was submitted to the H/W queues and was not completed yet. This is necessary to support suspend operation. Because the device will be reset upon suspend, we can only suspend after all active CS have been completed. Hence, we need to perform accounting on their number. Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/misc/habanalabs/device.c')
-rw-r--r--drivers/misc/habanalabs/device.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/device.c b/drivers/misc/habanalabs/device.c
index 93d67983ddba..470d8005b50e 100644
--- a/drivers/misc/habanalabs/device.c
+++ b/drivers/misc/habanalabs/device.c
@@ -218,6 +218,7 @@ static int device_early_init(struct hl_device *hdev)
spin_lock_init(&hdev->hw_queues_mirror_lock);
atomic_set(&hdev->in_reset, 0);
atomic_set(&hdev->fd_open_cnt, 0);
+ atomic_set(&hdev->cs_active_cnt, 0);
return 0;