aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs/common/context.c
diff options
context:
space:
mode:
authorOded Gabbay <ogabbay@kernel.org>2021-11-30 23:08:21 +0200
committerOded Gabbay <ogabbay@kernel.org>2021-12-26 08:59:08 +0200
commit5b90e59d55d94aa939fae941db4a0e613e6ecc1e (patch)
treee3226113771d41c167d633b5db227728f3e68b92 /drivers/misc/habanalabs/common/context.c
parenthabanalabs: add helper to get compute context (diff)
downloadlinux-dev-5b90e59d55d94aa939fae941db4a0e613e6ecc1e.tar.xz
linux-dev-5b90e59d55d94aa939fae941db4a0e613e6ecc1e.zip
habanalabs: remove compute context pointer
It was an error to save the compute context's pointer in the device structure, as it allowed its use without proper ref-cnt. Change the variable to a flag that only indicates whether there is an active compute context. Code that needs the pointer will now be forced to use proper internal APIs to get the pointer. Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/common/context.c')
-rw-r--r--drivers/misc/habanalabs/common/context.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/common/context.c b/drivers/misc/habanalabs/common/context.c
index b2884107fa15..49e6f1172d18 100644
--- a/drivers/misc/habanalabs/common/context.c
+++ b/drivers/misc/habanalabs/common/context.c
@@ -165,7 +165,7 @@ int hl_ctx_create(struct hl_device *hdev, struct hl_fpriv *hpriv)
hpriv->ctx = ctx;
/* TODO: remove the following line for multiple process support */
- hdev->compute_ctx = ctx;
+ hdev->is_compute_ctx_active = true;
return 0;