diff options
author | Moti Haimovski <mhaimovski@habana.ai> | 2020-10-27 11:03:32 +0200 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2020-11-30 10:47:35 +0200 |
commit | fe2bc2d249539c117cc887dc1f960ffcbba52d1e (patch) | |
tree | a27d616e6eef737982da9682e930d62d690803a6 /drivers/misc/habanalabs/common/mmu_v1.c | |
parent | 412c41fcd526b239472a24974591a05227bf5225 (diff) | |
download | linux-fe2bc2d249539c117cc887dc1f960ffcbba52d1e.tar.gz |
habanalabs: share a single ctx-mutex between all MMUs
Multiple locks are usually a source of problems, which in the MMU
case can be avoided since it is relatively rare that both MMU
tables are updated at the same time.
Therefore, use a single shared lock instead of two separate ones.
Signed-off-by: Moti Haimovski <mhaimovski@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/common/mmu_v1.c')
-rw-r--r-- | drivers/misc/habanalabs/common/mmu_v1.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/misc/habanalabs/common/mmu_v1.c b/drivers/misc/habanalabs/common/mmu_v1.c index 5f62cb158eef..92b22298bb5c 100644 --- a/drivers/misc/habanalabs/common/mmu_v1.c +++ b/drivers/misc/habanalabs/common/mmu_v1.c @@ -481,9 +481,7 @@ static void hl_mmu_v1_fini(struct hl_device *hdev) */ static int hl_mmu_v1_ctx_init(struct hl_ctx *ctx) { - mutex_init(&ctx->mmu_lock); hash_init(ctx->mmu_shadow_hash); - return dram_default_mapping_init(ctx); } @@ -516,8 +514,6 @@ static void hl_mmu_v1_ctx_fini(struct hl_ctx *ctx) pgt_info->phys_addr, ctx->asid, pgt_info->num_of_ptes); _free_hop(ctx, pgt_info); } - - mutex_destroy(&ctx->mmu_lock); } static int _hl_mmu_v1_unmap(struct hl_ctx *ctx, |