public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] habanalabs/gaudi: move mmu_prepare to context init
@ 2020-11-02 19:46 Oded Gabbay
  0 siblings, 0 replies; only message in thread
From: Oded Gabbay @ 2020-11-02 19:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: SW_Drivers, Ofir Bitton

From: Ofir Bitton <obitton@habana.ai>

Currently mmu_prepare is located at context switch.
Since we support a single context, no reason to reconfigure
the MMU registers every context switch.

Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
---
 drivers/misc/habanalabs/gaudi/gaudi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c
index 5f65a1691551..2910f427c716 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -4505,8 +4505,6 @@ static int gaudi_context_switch(struct hl_device *hdev, u32 asid)
 		return rc;
 	}
 
-	gaudi_mmu_prepare(hdev, asid);
-
 	gaudi_restore_user_registers(hdev);
 
 	return 0;
@@ -6359,6 +6357,8 @@ static enum hl_device_hw_state gaudi_get_hw_state(struct hl_device *hdev)
 
 static int gaudi_ctx_init(struct hl_ctx *ctx)
 {
+	gaudi_mmu_prepare(ctx->hdev, ctx->asid);
+
 	return 0;
 }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-02 19:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-02 19:46 [PATCH] habanalabs/gaudi: move mmu_prepare to context init Oded Gabbay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox