diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 1d6cdb53..9de589f9 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -2013,6 +2013,7 @@ static void gk20a_vm_remove_support(struct vm_gk20a *vm) | |||
2013 | struct mapped_buffer_node *mapped_buffer; | 2013 | struct mapped_buffer_node *mapped_buffer; |
2014 | struct vm_reserved_va_node *va_node, *va_node_tmp; | 2014 | struct vm_reserved_va_node *va_node, *va_node_tmp; |
2015 | struct rb_node *node; | 2015 | struct rb_node *node; |
2016 | int i; | ||
2016 | 2017 | ||
2017 | gk20a_dbg_fn(""); | 2018 | gk20a_dbg_fn(""); |
2018 | mutex_lock(&vm->update_gmmu_lock); | 2019 | mutex_lock(&vm->update_gmmu_lock); |
@@ -2035,8 +2036,25 @@ static void gk20a_vm_remove_support(struct vm_gk20a *vm) | |||
2035 | kfree(va_node); | 2036 | kfree(va_node); |
2036 | } | 2037 | } |
2037 | 2038 | ||
2038 | /* TBD: unmapping all buffers above may not actually free | 2039 | /* unmapping all buffers above may not actually free |
2039 | * all vm ptes. jettison them here for certain... */ | 2040 | * all vm ptes. jettison them here for certain... */ |
2041 | for (i = 0; i < vm->pdes.num_pdes; i++) { | ||
2042 | struct page_table_gk20a *pte = | ||
2043 | &vm->pdes.ptes[gmmu_page_size_small][i]; | ||
2044 | if (pte->ref) { | ||
2045 | free_gmmu_pages(vm, pte->ref, pte->sgt, | ||
2046 | vm->mm->page_table_sizing[gmmu_page_size_small].order, | ||
2047 | pte->size); | ||
2048 | pte->ref = NULL; | ||
2049 | } | ||
2050 | pte = &vm->pdes.ptes[gmmu_page_size_big][i]; | ||
2051 | if (pte->ref) { | ||
2052 | free_gmmu_pages(vm, pte->ref, pte->sgt, | ||
2053 | vm->mm->page_table_sizing[gmmu_page_size_big].order, | ||
2054 | pte->size); | ||
2055 | pte->ref = NULL; | ||
2056 | } | ||
2057 | } | ||
2040 | 2058 | ||
2041 | unmap_gmmu_pages(vm->pdes.ref, vm->pdes.sgt, vm->pdes.kv); | 2059 | unmap_gmmu_pages(vm->pdes.ref, vm->pdes.sgt, vm->pdes.kv); |
2042 | free_gmmu_pages(vm, vm->pdes.ref, vm->pdes.sgt, 0, vm->pdes.size); | 2060 | free_gmmu_pages(vm, vm->pdes.ref, vm->pdes.sgt, 0, vm->pdes.size); |