habanalabs: fix possible hole in device va
authorfarah kassabri <fkassabri@habana.ai>
Tue, 23 Aug 2022 11:32:42 +0000 (14:32 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 19 Sep 2022 12:08:38 +0000 (15:08 +0300)
commit62adba0a55a7dc522f179b8ff8e0b3b7250c440f
tree9a0a136c239b6890b359ffe914bf776a470125fa
parentf5ec364c9ecd1113492e15ceaafd4447f5836528
habanalabs: fix possible hole in device va

cb_map_mem() uses gen_pool_alloc() to get virtual address for
mapping a CB.
The mapping is done in chunks of page size, so if the CB size is
larger, it is possible that the allocated virtual addresses won't
be consecutive.
User retrieves this device VA which returns the virtual address
in the first va_block. If there is a "hole" in the virtual addresses,
user can configure a HW block with a bad device VA.

Signed-off-by: farah kassabri <fkassabri@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/command_buffer.c
drivers/misc/habanalabs/common/habanalabs.h