accel/habanalabs: use exported size from dma_buf and not from phys_pg_pack
authorTomer Tayar <ttayar@habana.ai>
Fri, 4 Aug 2023 14:42:13 +0000 (17:42 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 9 Oct 2023 09:37:21 +0000 (12:37 +0300)
commitefbca048c64bb00562c3e980dfc6ca47fff4fa0e
tree2c8998b3d9edd98560059506bb94e27718a9b7e7
parentdfdbc55a9c8c5ab00ae2d5963ac1199fdc9da2d3
accel/habanalabs: use exported size from dma_buf and not from phys_pg_pack

The 'exported_size' member in 'struct hl_vm_phys_pg_pack' is used to
keep the exported dma-buf size, to be later used when the buffer is
mapped.
However it is possible that the same phys_pg_pack will be exported more
than once, and independently of when the mapping takes place.
Remove this member from the phys_pg_pack structure, and simply use the
size in the dma-buf object as the exported size when mapping.

Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/accel/habanalabs/common/habanalabs.h
drivers/accel/habanalabs/common/memory.c