diff options
author | Arto Merilainen <amerilainen@nvidia.com> | 2014-05-06 11:05:31 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:09:47 -0400 |
commit | 219eb3d26bbcbede22c59e313c797e1854b12f2f (patch) | |
tree | 5be3b853f7dc2d200b9ebacbf3bdae485e97dfa9 /drivers/gpu | |
parent | 93044a4dc27b656d5acf2d134fff0446b8e04f85 (diff) |
gpu: nvgpu: Fixes to static offset mappings
This patch addresses two issues in fixes offset mappings:
- VA unmapping did not use lists safely. This caused an application hang
if the application did not free all (fixed offset) buffers before quiting.
- GPU was not powered closing AS node. If the address space had areas that
were not freed, the driver tried to access hw without powering it up first.
Change-Id: Ida526d222ea4e03b8d765eca16574ddc1823e60d
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/405872
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/as_gk20a.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/as_gk20a.c b/drivers/gpu/nvgpu/gk20a/as_gk20a.c index 1d604b83..42fa2167 100644 --- a/drivers/gpu/nvgpu/gk20a/as_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/as_gk20a.c | |||
@@ -73,6 +73,7 @@ static int gk20a_as_alloc_share(struct gk20a_as *as, | |||
73 | */ | 73 | */ |
74 | int gk20a_as_release_share(struct gk20a_as_share *as_share) | 74 | int gk20a_as_release_share(struct gk20a_as_share *as_share) |
75 | { | 75 | { |
76 | struct gk20a *g = as_share->vm->mm->g; | ||
76 | int err; | 77 | int err; |
77 | 78 | ||
78 | gk20a_dbg_fn(""); | 79 | gk20a_dbg_fn(""); |
@@ -80,7 +81,10 @@ int gk20a_as_release_share(struct gk20a_as_share *as_share) | |||
80 | if (atomic_dec_return(&as_share->ref_cnt) > 0) | 81 | if (atomic_dec_return(&as_share->ref_cnt) > 0) |
81 | return 0; | 82 | return 0; |
82 | 83 | ||
84 | gk20a_busy(g->dev); | ||
83 | err = gk20a_vm_release_share(as_share); | 85 | err = gk20a_vm_release_share(as_share); |
86 | gk20a_idle(g->dev); | ||
87 | |||
84 | release_as_share_id(as_share->as, as_share->id); | 88 | release_as_share_id(as_share->as, as_share->id); |
85 | kfree(as_share); | 89 | kfree(as_share); |
86 | return err; | 90 | return err; |
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index d2174f37..624eec94 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -2350,14 +2350,15 @@ int gk20a_vm_free_space(struct gk20a_as_share *as_share, | |||
2350 | mutex_lock(&vm->update_gmmu_lock); | 2350 | mutex_lock(&vm->update_gmmu_lock); |
2351 | va_node = addr_to_reservation(vm, args->offset); | 2351 | va_node = addr_to_reservation(vm, args->offset); |
2352 | if (va_node) { | 2352 | if (va_node) { |
2353 | struct mapped_buffer_node *buffer; | 2353 | struct mapped_buffer_node *buffer, *n; |
2354 | 2354 | ||
2355 | /* there is no need to unallocate the buffers in va. Just | 2355 | /* there is no need to unallocate the buffers in va. Just |
2356 | * convert them into normal buffers */ | 2356 | * convert them into normal buffers */ |
2357 | 2357 | ||
2358 | list_for_each_entry(buffer, | 2358 | list_for_each_entry_safe(buffer, n, |
2359 | &va_node->va_buffers_list, va_buffers_list) | 2359 | &va_node->va_buffers_list, va_buffers_list) { |
2360 | list_del_init(&buffer->va_buffers_list); | 2360 | list_del_init(&buffer->va_buffers_list); |
2361 | } | ||
2361 | 2362 | ||
2362 | list_del(&va_node->reserved_va_list); | 2363 | list_del(&va_node->reserved_va_list); |
2363 | 2364 | ||