accel/habanalabs: always pass exported size to alloc_sgt_from_device_pages()
authorTomer Tayar <ttayar@habana.ai>
Fri, 4 Aug 2023 14:12:58 +0000 (17:12 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 9 Oct 2023 09:37:21 +0000 (12:37 +0300)
commitdfdbc55a9c8c5ab00ae2d5963ac1199fdc9da2d3
treee4bc2068000a5c3a67450682e1e93cd475d22c9f
parent051868d93cfd342b4ff8e6297b93a6a43dbe81b3
accel/habanalabs: always pass exported size to alloc_sgt_from_device_pages()

For Gaudi1 the exported dma-buf is always composed of a single page, and
therefore the exported size is equal to this page's size.
When calling alloc_sgt_from_device_pages(), we pass 0 as the exported
size and internally calculate it as "number of pages * page size".
This makes alloc_sgt_from_device_pages() less clear, because the
exported size parameter is not understood as a restriction on the pages'
size.
Modify to always pass the exported size explicitly.

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/memory.c