diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2018-09-11 07:47:42 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2019-08-15 03:58:44 -0400 |
commit | 758cb76e225775ba5ac3dd2cb9415cb40dc83810 (patch) | |
tree | eabe117181e73f9ff8c7872b6ee20877416bd5b7 /drivers/gpu/nvgpu/os | |
parent | 44c23acfa4453d7f5773a8adc288358bc3f3b425 (diff) |
gpu: nvgpu: add FOREIGN_SGT mem flag
Add an internal flag NVGPU_MEM_FLAG_FOREIGN_SGT to specify that the sgt
member of an nvgpu_mem must not be freed when the nvgpu_mem is freed.
Bug 200145225
Bug 200541476
Change-Id: I044fb91a5f9d148f38fb0cbf63d0cdfd64a070ce
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1819801
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
(cherry picked from commit 9de6d20abb8fef0cd11c22676846d809ee3f9afc
in dev-main)
Reviewed-on: https://git-master.nvidia.com/r/2170602
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/linux-dma.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/linux-dma.c b/drivers/gpu/nvgpu/os/linux/linux-dma.c index 52987a87..d704b2a4 100644 --- a/drivers/gpu/nvgpu/os/linux/linux-dma.c +++ b/drivers/gpu/nvgpu/os/linux/linux-dma.c | |||
@@ -392,8 +392,10 @@ void nvgpu_dma_free_sys(struct gk20a *g, struct nvgpu_mem *mem) | |||
392 | if (mem->mem_flags & __NVGPU_MEM_FLAG_NO_DMA) | 392 | if (mem->mem_flags & __NVGPU_MEM_FLAG_NO_DMA) |
393 | nvgpu_kfree(g, mem->priv.pages); | 393 | nvgpu_kfree(g, mem->priv.pages); |
394 | 394 | ||
395 | if (mem->priv.sgt) | 395 | if ((mem->mem_flags & NVGPU_MEM_FLAG_FOREIGN_SGT) == 0 && |
396 | mem->priv.sgt != NULL) { | ||
396 | nvgpu_free_sgtable(g, &mem->priv.sgt); | 397 | nvgpu_free_sgtable(g, &mem->priv.sgt); |
398 | } | ||
397 | 399 | ||
398 | dma_dbg_free_done(g, mem->size, "sysmem"); | 400 | dma_dbg_free_done(g, mem->size, "sysmem"); |
399 | 401 | ||