diff options
author | Tomer Tayar <ttayar@habana.ai> | 2022-08-03 16:36:02 +0300 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2022-09-18 13:29:51 +0300 |
commit | 65d3c635137e24625740801dc21d885f66193299 (patch) | |
tree | efa4088b2ac8f79393399c5ba756bfc8102fe53b /drivers/misc/habanalabs/common/habanalabs.h | |
parent | 07ecaa0d85decb73a2907a4b419cfa7739517d5e (diff) | |
download | linux-65d3c635137e24625740801dc21d885f66193299.tar.xz |
habanalabs: fix H/W block handling for partial unmappings
Several munmap() calls can be done or a mapped H/W block that has a
larger size than a page size.
Releasing the object should be done only when all mapped range is
unmapped.
Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/common/habanalabs.h')
-rw-r--r-- | drivers/misc/habanalabs/common/habanalabs.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/misc/habanalabs/common/habanalabs.h b/drivers/misc/habanalabs/common/habanalabs.h index f495a4b82f73..237a887b3a43 100644 --- a/drivers/misc/habanalabs/common/habanalabs.h +++ b/drivers/misc/habanalabs/common/habanalabs.h @@ -2063,14 +2063,16 @@ struct hl_vm_hash_node { * @node: node to hang on the list in context object. * @ctx: the context this node belongs to. * @vaddr: virtual address of the HW block. - * @size: size of the block. + * @block_size: size of the block. + * @mapped_size: size of the block which is mapped. May change if partial un-mappings are done. * @id: HW block id (handle). */ struct hl_vm_hw_block_list_node { struct list_head node; struct hl_ctx *ctx; unsigned long vaddr; - u32 size; + u32 block_size; + u32 mapped_size; u32 id; }; |