mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
gpu: nvgpu: Use sg_alloc_table_for_pages
Use sg_alloc_table_for_pages to create sg_table for buffers allocated with NO_KERNEL_MAPPING. The old code returned always an sg_table with one chunk. sg_alloc_table_for_pages returns an sg_table which describes the actual physical chunks of the buffer. Bug 1605769 Change-Id: I412c0151d830fa0f53dbbb08ba8cc9ebce6699e3 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/723696
This commit is contained in:
committed by
Dan Willemsen
parent
87226707cf
commit
f09fa2cf20
@@ -1735,12 +1735,12 @@ int gk20a_get_sgtable_from_pages(struct device *d, struct sg_table **sgt,
|
||||
err = -ENOMEM;
|
||||
goto fail;
|
||||
}
|
||||
err = sg_alloc_table(*sgt, 1, GFP_KERNEL);
|
||||
err = sg_alloc_table_from_pages(*sgt, pages,
|
||||
DIV_ROUND_UP(size, 4096), 0, size, GFP_KERNEL);
|
||||
if (err) {
|
||||
dev_err(d, "failed to allocate sg_table\n");
|
||||
goto fail;
|
||||
}
|
||||
sg_set_page((*sgt)->sgl, *pages, size, 0);
|
||||
sg_dma_address((*sgt)->sgl) = iova;
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user