diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 11 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c | 11 |
2 files changed, 17 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 9ed4febb..f632245e 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -2235,10 +2235,15 @@ static void gk20a_gr_destroy_ctx_buffer(struct platform_device *pdev, | |||
2235 | struct device *dev = &pdev->dev; | 2235 | struct device *dev = &pdev->dev; |
2236 | if (!desc) | 2236 | if (!desc) |
2237 | return; | 2237 | return; |
2238 | if (desc->sgt) | 2238 | if (desc->sgt) { |
2239 | gk20a_free_sgtable(&desc->sgt); | 2239 | gk20a_free_sgtable(&desc->sgt); |
2240 | dma_free_attrs(dev, desc->size, desc->pages, | 2240 | desc->sgt = NULL; |
2241 | } | ||
2242 | if (desc->pages) { | ||
2243 | dma_free_attrs(dev, desc->size, desc->pages, | ||
2241 | desc->iova, &desc->attrs); | 2244 | desc->iova, &desc->attrs); |
2245 | desc->pages = NULL; | ||
2246 | } | ||
2242 | } | 2247 | } |
2243 | 2248 | ||
2244 | static int gk20a_gr_alloc_ctx_buffer(struct platform_device *pdev, | 2249 | static int gk20a_gr_alloc_ctx_buffer(struct platform_device *pdev, |
@@ -4510,7 +4515,7 @@ out: | |||
4510 | else | 4515 | else |
4511 | gk20a_dbg_fn("done"); | 4516 | gk20a_dbg_fn("done"); |
4512 | 4517 | ||
4513 | return 0; | 4518 | return err; |
4514 | } | 4519 | } |
4515 | 4520 | ||
4516 | static int gk20a_init_gr_reset_enable_hw(struct gk20a *g) | 4521 | static int gk20a_init_gr_reset_enable_hw(struct gk20a *g) |
diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c index 0d5f32dd..313962a1 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a_tegra.c | |||
@@ -78,10 +78,17 @@ static int gk20a_tegra_secure_page_alloc(struct platform_device *pdev) | |||
78 | static void gk20a_tegra_secure_destroy(struct platform_device *pdev, | 78 | static void gk20a_tegra_secure_destroy(struct platform_device *pdev, |
79 | struct gr_ctx_buffer_desc *desc) | 79 | struct gr_ctx_buffer_desc *desc) |
80 | { | 80 | { |
81 | gk20a_free_sgtable(&desc->sgt); | 81 | if (desc->sgt) { |
82 | dma_free_attrs(&tegra_vpr_dev, desc->size, | 82 | gk20a_free_sgtable(&desc->sgt); |
83 | desc->sgt = NULL; | ||
84 | } | ||
85 | |||
86 | if (desc->iova) { | ||
87 | dma_free_attrs(&tegra_vpr_dev, desc->size, | ||
83 | (void *)(uintptr_t)desc->iova, | 88 | (void *)(uintptr_t)desc->iova, |
84 | desc->iova, &desc->attrs); | 89 | desc->iova, &desc->attrs); |
90 | desc->iova = 0; | ||
91 | } | ||
85 | } | 92 | } |
86 | 93 | ||
87 | static int gk20a_tegra_secure_alloc(struct platform_device *pdev, | 94 | static int gk20a_tegra_secure_alloc(struct platform_device *pdev, |