diff mbox series

[04/12] accel/habanalabs/gaudi2: fix missing check of kernel ctx

Message ID 20230711111226.163670-4-ogabbay@kernel.org (mailing list archive)
State New, archived
Headers show
Series [01/12] accel/habanalabs/gaudi2: un-secure register for engine cores interrupt | expand

Commit Message

Oded Gabbay July 11, 2023, 11:12 a.m. UTC
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@kernel.org>
---
 drivers/accel/habanalabs/gaudi2/gaudi2.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Ofir Bitton July 12, 2023, 11:58 a.m. UTC | #1
On 11/07/2023 14:12, Oded Gabbay wrote:
> 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@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;

Reviewed-by: Ofir Bitton <obitton@habana.ai>
diff mbox series

Patch

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;