summaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs/gaudi
diff options
context:
space:
mode:
authorOfir Bitton <obitton@habana.ai>2020-09-30 14:51:10 +0200
committerOded Gabbay <ogabbay@kernel.org>2020-11-30 09:47:27 +0100
commit20b7525dc430aa97748c5ddaff9f791ce1022690 (patch)
tree368a24b0473cab6c38f8a884809e325038bb6e28 /drivers/misc/habanalabs/gaudi
parenthabanalabs: change aggregate cs counters to atomic (diff)
downloadlinux-20b7525dc430aa97748c5ddaff9f791ce1022690.tar.xz
linux-20b7525dc430aa97748c5ddaff9f791ce1022690.zip
habanalabs/gaudi: move mmu_prepare to context init
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>
Diffstat (limited to 'drivers/misc/habanalabs/gaudi')
-rw-r--r--drivers/misc/habanalabs/gaudi/gaudi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/habanalabs/gaudi/gaudi.c b/drivers/misc/habanalabs/gaudi/gaudi.c
index 7ea6b4368a91..ac0b4e076148 100644
--- a/drivers/misc/habanalabs/gaudi/gaudi.c
+++ b/drivers/misc/habanalabs/gaudi/gaudi.c
@@ -4500,8 +4500,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;
@@ -6353,6 +6351,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;
}