aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs/common/context.c
diff options
context:
space:
mode:
authorDani Liberman <dliberman@habana.ai>2021-12-08 09:52:03 +0200
committerOded Gabbay <ogabbay@kernel.org>2021-12-26 08:59:09 +0200
commit707c1252868d885c47b80613b60bdcb19e133397 (patch)
tree08e18a1b2fefe2b85dd06fa9ab4ba3de9f4e703f /drivers/misc/habanalabs/common/context.c
parenthabanalabs: fix hwmon handling for legacy f/w (diff)
downloadlinux-dev-707c1252868d885c47b80613b60bdcb19e133397.tar.xz
linux-dev-707c1252868d885c47b80613b60bdcb19e133397.zip
habanalabs: keep control device alive during hard reset
Need to allow user retrieve data during reset and afterwards without the need to reopen the device. Did it by seperating the user peocesses list into two lists: 1. fpriv_list which contains list of user processes that opened the device (currently only one). 2. fpriv_ctrl_list which contains list of user processes that opened the control device. This processes in this list shall not be killed during reset, only when the device is suddenly removed from PCI chain. Signed-off-by: Dani Liberman <dliberman@habana.ai> Reviewed-by: Oded Gabbay <ogabbay@kernel.org> 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.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/misc/habanalabs/common/context.c b/drivers/misc/habanalabs/common/context.c
index 49e6f1172d18..c6360e33bce8 100644
--- a/drivers/misc/habanalabs/common/context.c
+++ b/drivers/misc/habanalabs/common/context.c
@@ -283,11 +283,9 @@ struct hl_ctx *hl_get_compute_ctx(struct hl_device *hdev)
/* There can only be a single user which has opened the compute device, so exit
* immediately once we find him
*/
- if (!hpriv->is_control) {
- ctx = hpriv->ctx;
- hl_ctx_get(hdev, ctx);
- break;
- }
+ ctx = hpriv->ctx;
+ hl_ctx_get(hdev, ctx);
+ break;
}
mutex_unlock(&hdev->fpriv_list_lock);