summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 9e6dc74c..c31f8482 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -22,7 +22,6 @@
22#include <linux/nvhost.h> 22#include <linux/nvhost.h>
23#include <linux/scatterlist.h> 23#include <linux/scatterlist.h>
24#include <linux/nvmap.h> 24#include <linux/nvmap.h>
25#include <soc/tegra/chip-id.h>
26#include <linux/vmalloc.h> 25#include <linux/vmalloc.h>
27#include <linux/dma-buf.h> 26#include <linux/dma-buf.h>
28#include <linux/dma-mapping.h> 27#include <linux/dma-mapping.h>
@@ -1543,7 +1542,6 @@ static void gk20a_vm_unmap_user(struct vm_gk20a *vm, u64 offset,
1543 struct vm_gk20a_mapping_batch *batch) 1542 struct vm_gk20a_mapping_batch *batch)
1544{ 1543{
1545 struct device *d = dev_from_vm(vm); 1544 struct device *d = dev_from_vm(vm);
1546 int retries = 10000; /* 50 ms */
1547 struct mapped_buffer_node *mapped_buffer; 1545 struct mapped_buffer_node *mapped_buffer;
1548 1546
1549 nvgpu_mutex_acquire(&vm->update_gmmu_lock); 1547 nvgpu_mutex_acquire(&vm->update_gmmu_lock);
@@ -1556,17 +1554,19 @@ static void gk20a_vm_unmap_user(struct vm_gk20a *vm, u64 offset,
1556 } 1554 }
1557 1555
1558 if (mapped_buffer->flags & NVGPU_AS_MAP_BUFFER_FLAGS_FIXED_OFFSET) { 1556 if (mapped_buffer->flags & NVGPU_AS_MAP_BUFFER_FLAGS_FIXED_OFFSET) {
1557 struct nvgpu_timeout timeout;
1558
1559 nvgpu_mutex_release(&vm->update_gmmu_lock); 1559 nvgpu_mutex_release(&vm->update_gmmu_lock);
1560 1560
1561 while (retries >= 0 || !tegra_platform_is_silicon()) { 1561 nvgpu_timeout_init(vm->mm->g, &timeout, 10000,
1562 NVGPU_TIMER_RETRY_TIMER);
1563 do {
1562 if (atomic_read(&mapped_buffer->ref.refcount) == 1) 1564 if (atomic_read(&mapped_buffer->ref.refcount) == 1)
1563 break; 1565 break;
1564 retries--;
1565 udelay(5); 1566 udelay(5);
1566 } 1567 } while (!nvgpu_timeout_expired_msg(&timeout,
1567 if (retries < 0 && tegra_platform_is_silicon()) 1568 "sync-unmap failed on 0x%llx"));
1568 gk20a_err(d, "sync-unmap failed on 0x%llx", 1569
1569 offset);
1570 nvgpu_mutex_acquire(&vm->update_gmmu_lock); 1570 nvgpu_mutex_acquire(&vm->update_gmmu_lock);
1571 } 1571 }
1572 1572