diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2015-05-18 19:12:05 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2015-06-06 10:26:05 -0400 |
commit | 8c8d05aec755ee509e17bd495f424b6ca25f7c9f (patch) | |
tree | 8b45ded7a61bee11c1a2e0c1dbf1e64d2577a308 /drivers/gpu/nvgpu | |
parent | 2d7c96c5e90b18ba6ef61ff866c2846c71388b42 (diff) |
gpu: nvgpu: Infinite wait for fixed alloc unmap
In non-silicon wait infinitely for all jobs to complete before
unmapping a fixed allocation.
Bug 200078514
Change-Id: I9196afb1d3c5f0c999113a4a17ada2989ac55707
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/744067
(cherry picked from commit 6ccac11b4dd1a4eaf9c914fd567cdf7922184e28)
Reviewed-on: http://git-master/r/753284
Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index e3ec3f10..f5ce886a 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -810,7 +810,7 @@ void gk20a_vm_put_buffers(struct vm_gk20a *vm, | |||
810 | static void gk20a_vm_unmap_user(struct vm_gk20a *vm, u64 offset) | 810 | static void gk20a_vm_unmap_user(struct vm_gk20a *vm, u64 offset) |
811 | { | 811 | { |
812 | struct device *d = dev_from_vm(vm); | 812 | struct device *d = dev_from_vm(vm); |
813 | int retries; | 813 | int retries = 1000; |
814 | struct mapped_buffer_node *mapped_buffer; | 814 | struct mapped_buffer_node *mapped_buffer; |
815 | 815 | ||
816 | mutex_lock(&vm->update_gmmu_lock); | 816 | mutex_lock(&vm->update_gmmu_lock); |
@@ -825,17 +825,13 @@ static void gk20a_vm_unmap_user(struct vm_gk20a *vm, u64 offset) | |||
825 | if (mapped_buffer->flags & NVGPU_AS_MAP_BUFFER_FLAGS_FIXED_OFFSET) { | 825 | if (mapped_buffer->flags & NVGPU_AS_MAP_BUFFER_FLAGS_FIXED_OFFSET) { |
826 | mutex_unlock(&vm->update_gmmu_lock); | 826 | mutex_unlock(&vm->update_gmmu_lock); |
827 | 827 | ||
828 | if (tegra_platform_is_silicon()) | 828 | while (retries >= 0 || !tegra_platform_is_silicon()) { |
829 | retries = 1000; | ||
830 | else | ||
831 | retries = 1000000; | ||
832 | while (retries) { | ||
833 | if (atomic_read(&mapped_buffer->ref.refcount) == 1) | 829 | if (atomic_read(&mapped_buffer->ref.refcount) == 1) |
834 | break; | 830 | break; |
835 | retries--; | 831 | retries--; |
836 | udelay(50); | 832 | udelay(5); |
837 | } | 833 | } |
838 | if (!retries) | 834 | if (retries < 0 && tegra_platform_is_silicon()) |
839 | gk20a_err(d, "sync-unmap failed on 0x%llx", | 835 | gk20a_err(d, "sync-unmap failed on 0x%llx", |
840 | offset); | 836 | offset); |
841 | mutex_lock(&vm->update_gmmu_lock); | 837 | mutex_lock(&vm->update_gmmu_lock); |