aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs/common/context.c
diff options
context:
space:
mode:
authorOhad Sharabi <osharabi@habana.ai>2021-01-17 16:01:56 +0200
committerOded Gabbay <ogabbay@kernel.org>2021-01-27 21:03:51 +0200
commitcf30339d3f44a64115e88d46a932fdc3d3644785 (patch)
tree94b5911de1c3ebad848348e4d1c6fefdd4564143 /drivers/misc/habanalabs/common/context.c
parenthabanalabs: add CS completion and timeout properties (diff)
downloadlinux-dev-cf30339d3f44a64115e88d46a932fdc3d3644785.tar.xz
linux-dev-cf30339d3f44a64115e88d46a932fdc3d3644785.zip
habanalabs: modify device_idle interface
Currently this API uses single 64 bits mask for engines idle indication. Recently, it was observed that more bits are needed for some ASICs. This patch modifies the use of the idle mask and the idle_extensions mask. Signed-off-by: Ohad Sharabi <osharabi@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.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/misc/habanalabs/common/context.c b/drivers/misc/habanalabs/common/context.c
index 829fe98eed61..cda871afb8f4 100644
--- a/drivers/misc/habanalabs/common/context.c
+++ b/drivers/misc/habanalabs/common/context.c
@@ -12,7 +12,7 @@
static void hl_ctx_fini(struct hl_ctx *ctx)
{
struct hl_device *hdev = ctx->hdev;
- u64 idle_mask = 0;
+ u64 idle_mask[HL_BUSY_ENGINES_MASK_EXT_SIZE] = {0};
int i;
/* Release all allocated pending cb's, those cb's were never
@@ -55,10 +55,11 @@ static void hl_ctx_fini(struct hl_ctx *ctx)
if ((!hdev->pldm) && (hdev->pdev) &&
(!hdev->asic_funcs->is_device_idle(hdev,
- &idle_mask, NULL)))
+ idle_mask,
+ HL_BUSY_ENGINES_MASK_EXT_SIZE, NULL)))
dev_notice(hdev->dev,
- "device not idle after user context is closed (0x%llx)\n",
- idle_mask);
+ "device not idle after user context is closed (0x%llx, 0x%llx)\n",
+ idle_mask[0], idle_mask[1]);
} else {
dev_dbg(hdev->dev, "closing kernel context\n");
hdev->asic_funcs->ctx_fini(ctx);