diff options
author | Richard Zhao <rizhao@nvidia.com> | 2018-09-17 14:37:41 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-21 14:22:20 -0400 |
commit | a4065effdca2d16a870d05f1bf8715267635d401 (patch) | |
tree | 9257e33af4dfb1340abfdb9d9a17439c0accf4be | |
parent | 57e8a2417b256921acb07e9b490941c8ec9e0479 (diff) |
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 <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1828562
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/vm.c | 10 |
1 files changed, 6 insertions, 4 deletions
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, | |||
1179 | nvgpu_mutex_release(&vm->update_gmmu_lock); | 1179 | nvgpu_mutex_release(&vm->update_gmmu_lock); |
1180 | 1180 | ||
1181 | /* | 1181 | /* |
1182 | * 500ms second timer. | 1182 | * 100ms timer. |
1183 | */ | 1183 | */ |
1184 | nvgpu_timeout_init(vm->mm->g, &timeout, 50, NVGPU_TIMER_CPU_TIMER); | 1184 | nvgpu_timeout_init(vm->mm->g, &timeout, 100, NVGPU_TIMER_CPU_TIMER); |
1185 | 1185 | ||
1186 | do { | 1186 | do { |
1187 | if (nvgpu_atomic_read(&mapped_buffer->ref.refcount) == 1) { | 1187 | if (nvgpu_atomic_read(&mapped_buffer->ref.refcount) == 1) { |
@@ -1189,9 +1189,11 @@ static int nvgpu_vm_unmap_sync_buffer(struct vm_gk20a *vm, | |||
1189 | } | 1189 | } |
1190 | nvgpu_msleep(10); | 1190 | nvgpu_msleep(10); |
1191 | } while (nvgpu_timeout_expired_msg(&timeout, | 1191 | } while (nvgpu_timeout_expired_msg(&timeout, |
1192 | "sync-unmap failed on 0x%llx") == 0); | 1192 | "sync-unmap failed on 0x%llx", |
1193 | mapped_buffer->addr) == 0); | ||
1193 | 1194 | ||
1194 | if (nvgpu_timeout_expired(&timeout)) { | 1195 | if (nvgpu_atomic_read(&mapped_buffer->ref.refcount) != 1 && |
1196 | nvgpu_timeout_expired(&timeout)) { | ||
1195 | ret = -ETIMEDOUT; | 1197 | ret = -ETIMEDOUT; |
1196 | } | 1198 | } |
1197 | 1199 | ||