diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 26 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 3 |
2 files changed, 17 insertions, 12 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 32ccc5b8..b12091bf 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -1898,19 +1898,23 @@ void gk20a_gmmu_free_attr(struct gk20a *g, enum dma_attr attr, | |||
1898 | if (attr) { | 1898 | if (attr) { |
1899 | DEFINE_DMA_ATTRS(attrs); | 1899 | DEFINE_DMA_ATTRS(attrs); |
1900 | dma_set_attr(attr, &attrs); | 1900 | dma_set_attr(attr, &attrs); |
1901 | if (attr == DMA_ATTR_NO_KERNEL_MAPPING) | 1901 | if (attr == DMA_ATTR_NO_KERNEL_MAPPING) { |
1902 | dma_free_attrs(d, mem->size, mem->pages, | 1902 | if (mem->pages) |
1903 | sg_dma_address(mem->sgt->sgl), | 1903 | dma_free_attrs(d, mem->size, mem->pages, |
1904 | &attrs); | 1904 | sg_dma_address(mem->sgt->sgl), |
1905 | else | 1905 | &attrs); |
1906 | dma_free_attrs(d, mem->size, mem->cpu_va, | 1906 | } else { |
1907 | sg_dma_address(mem->sgt->sgl), | 1907 | if (mem->cpu_va) |
1908 | &attrs); | 1908 | dma_free_attrs(d, mem->size, |
1909 | mem->cpu_va, | ||
1910 | sg_dma_address(mem->sgt->sgl), | ||
1911 | &attrs); | ||
1912 | } | ||
1909 | } else { | 1913 | } else { |
1910 | dma_free_coherent(d, mem->size, mem->cpu_va, | 1914 | if (mem->cpu_va) |
1911 | sg_dma_address(mem->sgt->sgl)); | 1915 | dma_free_coherent(d, mem->size, mem->cpu_va, |
1916 | sg_dma_address(mem->sgt->sgl)); | ||
1912 | } | 1917 | } |
1913 | |||
1914 | mem->cpu_va = NULL; | 1918 | mem->cpu_va = NULL; |
1915 | mem->pages = NULL; | 1919 | mem->pages = NULL; |
1916 | } | 1920 | } |
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index de44f925..77c5da0a 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | |||
@@ -2286,7 +2286,8 @@ void gk20a_remove_pmu_support(struct pmu_gk20a *pmu) | |||
2286 | { | 2286 | { |
2287 | gk20a_dbg_fn(""); | 2287 | gk20a_dbg_fn(""); |
2288 | 2288 | ||
2289 | gk20a_allocator_destroy(&pmu->dmem); | 2289 | if (pmu->dmem.init) |
2290 | gk20a_allocator_destroy(&pmu->dmem); | ||
2290 | } | 2291 | } |
2291 | 2292 | ||
2292 | static int gk20a_init_pmu_reset_enable_hw(struct gk20a *g) | 2293 | static int gk20a_init_pmu_reset_enable_hw(struct gk20a *g) |