habanalabs: fix H/W block handling for partial unmappings
authorTomer Tayar <ttayar@habana.ai>
Wed, 3 Aug 2022 13:36:02 +0000 (16:36 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Sun, 18 Sep 2022 10:29:51 +0000 (13:29 +0300)
commit65d3c635137e24625740801dc21d885f66193299
treeefa4088b2ac8f79393399c5ba756bfc8102fe53b
parent07ecaa0d85decb73a2907a4b419cfa7739517d5e
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>
drivers/misc/habanalabs/common/debugfs.c
drivers/misc/habanalabs/common/habanalabs.h
drivers/misc/habanalabs/common/memory.c