]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
accel/habanalabs/gaudi2: fix missing check of kernel ctx
authorOded Gabbay <ogabbay@kernel.org>
Tue, 11 Jul 2023 07:28:18 +0000 (10:28 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 9 Oct 2023 09:37:19 +0000 (12:37 +0300)
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.

Reviewed-by: Ofir Bitton <obitton@habana.ai>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/accel/habanalabs/gaudi2/gaudi2.c

index 2b537ef6a5506bccd264222256f0218d26f15f5d..22a9aee9a7c961568ebc51af3aae4a28f97ed737 100644 (file)
@@ -10651,6 +10651,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;