From a4065effdca2d16a870d05f1bf8715267635d401 Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Mon, 17 Sep 2018 11:37:41 -0700 Subject: gpu: nvgpu: increase sync-unmap timeout to 100ms - sync-unmap timeout was observed intermittently. so doubled the timeout value. - also check ref count after last round of sleep. The polling could succeed during the last sleep. - fix error print on timeout. Bug 200434475 Change-Id: If821dfaca9b86873711f436645523dc49a5eba34 Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1828562 Reviewed-by: svc-misra-checker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/mm/vm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/common/mm/vm.c b/drivers/gpu/nvgpu/common/mm/vm.c index 98bad70b..33587e5d 100644 --- a/drivers/gpu/nvgpu/common/mm/vm.c +++ b/drivers/gpu/nvgpu/common/mm/vm.c @@ -1179,9 +1179,9 @@ static int nvgpu_vm_unmap_sync_buffer(struct vm_gk20a *vm, nvgpu_mutex_release(&vm->update_gmmu_lock); /* - * 500ms second timer. + * 100ms timer. */ - nvgpu_timeout_init(vm->mm->g, &timeout, 50, NVGPU_TIMER_CPU_TIMER); + nvgpu_timeout_init(vm->mm->g, &timeout, 100, NVGPU_TIMER_CPU_TIMER); do { if (nvgpu_atomic_read(&mapped_buffer->ref.refcount) == 1) { @@ -1189,9 +1189,11 @@ static int nvgpu_vm_unmap_sync_buffer(struct vm_gk20a *vm, } nvgpu_msleep(10); } while (nvgpu_timeout_expired_msg(&timeout, - "sync-unmap failed on 0x%llx") == 0); + "sync-unmap failed on 0x%llx", + mapped_buffer->addr) == 0); - if (nvgpu_timeout_expired(&timeout)) { + if (nvgpu_atomic_read(&mapped_buffer->ref.refcount) != 1 && + nvgpu_timeout_expired(&timeout)) { ret = -ETIMEDOUT; } -- cgit v1.2.2