summaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs/goya/goya.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/goya/goya.c
parent4337b50b5fe5ee64c821790f601ee6153bb9f027 (diff)
downloadlinux-5b90e59d55d94aa939fae941db4a0e613e6ecc1e.tar.gz
linux-5b90e59d55d94aa939fae941db4a0e613e6ecc1e.tar.bz2
linux-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/goya/goya.c')
-rw-r--r--drivers/misc/habanalabs/goya/goya.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
index e54d60e75854..8d0f2cd608fc 100644
--- a/drivers/misc/habanalabs/goya/goya.c
+++ b/drivers/misc/habanalabs/goya/goya.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
/*
- * Copyright 2016-2019 HabanaLabs, Ltd.
+ * Copyright 2016-2021 HabanaLabs, Ltd.
* All Rights Reserved.
*/
@@ -827,7 +827,7 @@ static void goya_set_freq_to_low_job(struct work_struct *work)
mutex_lock(&hdev->fpriv_list_lock);
- if (!hdev->compute_ctx)
+ if (!hdev->is_compute_ctx_active)
goya_set_frequency(hdev, PLL_LOW);
mutex_unlock(&hdev->fpriv_list_lock);