diff options
author | Oded Gabbay <oded.gabbay@gmail.com> | 2019-07-30 11:49:36 +0300 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2019-09-05 14:55:26 +0300 |
commit | 86d5307a6d3507258460939fab040c6aafb506f9 (patch) | |
tree | 28a772c19bfbc55e0cf88a6c560e3b10c9ee2ff3 /drivers/misc/habanalabs/device.c | |
parent | 02e921e42b277c632ebdce355cc22d145944e968 (diff) |
habanalabs: rename user_ctx as compute_ctx
This patch renames the "user_ctx" field in the device structure to
"compute_ctx". This better reflects the meaning of this context.
In addition, we also check in the ctx_fini() that the debug mode should be
disabled only if the context being destroyed is the compute context. This
has no effect right now as we only have a single process and a single
context, but this makes the code more ready for multiple process support.
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/habanalabs/device.c')
-rw-r--r-- | drivers/misc/habanalabs/device.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/misc/habanalabs/device.c b/drivers/misc/habanalabs/device.c index 257438d7a632..e19ab8752210 100644 --- a/drivers/misc/habanalabs/device.c +++ b/drivers/misc/habanalabs/device.c @@ -59,7 +59,7 @@ static void hpriv_release(struct kref *ref) atomic_dec(&hdev->fd_open_cnt); /* This allows a new user context to open the device */ - hdev->user_ctx = NULL; + hdev->compute_ctx = NULL; } void hl_hpriv_get(struct hl_fpriv *hpriv) @@ -590,7 +590,7 @@ static void device_kill_open_processes(struct hl_device *hdev) } if (atomic_read(&hdev->fd_open_cnt)) { - task = get_pid_task(hdev->user_ctx->hpriv->taskpid, + task = get_pid_task(hdev->compute_ctx->hpriv->taskpid, PIDTYPE_PID); if (task) { dev_info(hdev->dev, "Killing user processes\n"); @@ -760,9 +760,9 @@ again: hl_cq_reset(hdev, &hdev->completion_queue[i]); /* Make sure the context switch phase will run again */ - if (hdev->user_ctx) { - atomic_set(&hdev->user_ctx->thread_ctx_switch_token, 1); - hdev->user_ctx->thread_ctx_switch_wait_token = 0; + if (hdev->compute_ctx) { + atomic_set(&hdev->compute_ctx->thread_ctx_switch_token, 1); + hdev->compute_ctx->thread_ctx_switch_wait_token = 0; } /* Finished tear-down, starting to re-initialize */ @@ -793,7 +793,7 @@ again: goto out_err; } - hdev->user_ctx = NULL; + hdev->compute_ctx = NULL; rc = hl_ctx_init(hdev, hdev->kernel_ctx, true); if (rc) { @@ -970,7 +970,7 @@ int hl_device_init(struct hl_device *hdev, struct class *hclass) goto mmu_fini; } - hdev->user_ctx = NULL; + hdev->compute_ctx = NULL; rc = hl_ctx_init(hdev, hdev->kernel_ctx, true); if (rc) { |