From patchwork Tue Jul 11 11:12:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 13308425 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 464DEEB64DD for ; Tue, 11 Jul 2023 11:13:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F035010E379; Tue, 11 Jul 2023 11:12:48 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id 16E1210E372 for ; Tue, 11 Jul 2023 11:12:37 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 915A56142E for ; Tue, 11 Jul 2023 11:12:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D243C433C9 for ; Tue, 11 Jul 2023 11:12:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689073956; bh=MCArzWC6q+e9w3lwQdYeV+tlqHV0iwb092ut/gu8pVU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RPBakGMgPo3o+5meJk+uAoOQCfgixVJx4GDLBq4ifPHrDihRyFlpWZ1nSlTOONDM3 sreqSL6wX+S7kFi+7TUVkHsllDmkKTDFnkiSYYqaug3WyCxNF5MHeplm5/v8QK1BiF lMCJYVqQ7SBHLMdUWXi1MpL90gmHo2gJ0kwepC37Yurt6IzuQRpT5400x4KPT8mWTD kdpq/XmKRybjdD0lFYJPfOBqodfrj2N3Lz/hJzKkPtCOf4WPluXvO43H8QJ6/t2zuP q8GjaLFVmliEk5pEGvocW3Z4VCU+Y5Kbo80XTswzMzm0bxbCx1qNuaekXBQ6NaeivU 45I29/BzzVz0w== From: Oded Gabbay To: dri-devel@lists.freedesktop.org Subject: [PATCH 04/12] accel/habanalabs/gaudi2: fix missing check of kernel ctx Date: Tue, 11 Jul 2023 14:12:18 +0300 Message-Id: <20230711111226.163670-4-ogabbay@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230711111226.163670-1-ogabbay@kernel.org> References: <20230711111226.163670-1-ogabbay@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Reviewed-by: Ofir Bitton --- 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;