[PATCH 04/12] accel/habanalabs/gaudi2: fix missing check of kernel ctx
Oded Gabbay
ogabbay at kernel.org
Tue Jul 11 11:12:18 UTC 2023
If we are initializing the kernel context when we have a Gaudi2 device,
we don't need to do any late initializing of that context with
specific Gaudi2 code.
Signed-off-by: Oded Gabbay <ogabbay at kernel.org>
---
drivers/accel/habanalabs/gaudi2/gaudi2.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/accel/habanalabs/gaudi2/gaudi2.c b/drivers/accel/habanalabs/gaudi2/gaudi2.c
index 0f9e9522233f..70b8f744cd73 100644
--- a/drivers/accel/habanalabs/gaudi2/gaudi2.c
+++ b/drivers/accel/habanalabs/gaudi2/gaudi2.c
@@ -10650,6 +10650,9 @@ static int gaudi2_ctx_init(struct hl_ctx *ctx)
{
int rc;
+ if (ctx->asid == HL_KERNEL_ASID_ID)
+ return 0;
+
rc = gaudi2_mmu_prepare(ctx->hdev, ctx->asid);
if (rc)
return rc;
--
2.34.1
More information about the dri-devel
mailing list