summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common
diff options
context:
space:
mode:
authorBharat Nihalani <bnihalani@nvidia.com>2017-06-16 03:13:47 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-06-19 17:35:13 -0400
commit2535c81c6c916f9f2e1224e17e80d240df569e49 (patch)
tree6d84117ff417dde8cc23db4060e5e898ef74f2e5 /drivers/gpu/nvgpu/common
parent8dc75c172567ce81819b75cd9714fc887174583b (diff)
gpu: nvgpu: use usleep_range instead of msleep
msleep is not recommended for (1ms - 20ms). So use usleep_range instead to have a more deterministic sleep time. Also fix the print for target_ref_count that could either be 2 or 1 based on whether GPU rail-gating is enabled or not. Bug 200294536 Change-Id: I26c9ed8a1badc84db5efa89347a227e6b46f603c Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-on: http://git-master/r/1500409 Reviewed-on: http://git-master/r/1503628 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r--drivers/gpu/nvgpu/common/linux/module.c6
-rw-r--r--drivers/gpu/nvgpu/common/pmu/pmu.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c
index 80c516a6..7c7cc714 100644
--- a/drivers/gpu/nvgpu/common/linux/module.c
+++ b/drivers/gpu/nvgpu/common/linux/module.c
@@ -337,12 +337,12 @@ int __gk20a_do_idle(struct gk20a *g, bool force_reset)
337 337
338 /* check and wait until GPU is idle (with a timeout) */ 338 /* check and wait until GPU is idle (with a timeout) */
339 do { 339 do {
340 nvgpu_msleep(1); 340 nvgpu_usleep_range(1000, 1100);
341 ref_cnt = atomic_read(&dev->power.usage_count); 341 ref_cnt = atomic_read(&dev->power.usage_count);
342 } while (ref_cnt != target_ref_cnt && !nvgpu_timeout_expired(&timeout)); 342 } while (ref_cnt != target_ref_cnt && !nvgpu_timeout_expired(&timeout));
343 343
344 if (ref_cnt != target_ref_cnt) { 344 if (ref_cnt != target_ref_cnt) {
345 nvgpu_err(g, "failed to idle - refcount %d != 1", 345 nvgpu_err(g, "failed to idle - refcount %d != target_ref_cnt",
346 ref_cnt); 346 ref_cnt);
347 goto fail_drop_usage_count; 347 goto fail_drop_usage_count;
348 } 348 }
@@ -367,7 +367,7 @@ int __gk20a_do_idle(struct gk20a *g, bool force_reset)
367 367
368 /* check in loop if GPU is railgated or not */ 368 /* check in loop if GPU is railgated or not */
369 do { 369 do {
370 nvgpu_msleep(1); 370 nvgpu_usleep_range(1000, 1100);
371 is_railgated = platform->is_railgated(dev); 371 is_railgated = platform->is_railgated(dev);
372 } while (!is_railgated && !nvgpu_timeout_expired(&timeout)); 372 } while (!is_railgated && !nvgpu_timeout_expired(&timeout));
373 373
diff --git a/drivers/gpu/nvgpu/common/pmu/pmu.c b/drivers/gpu/nvgpu/common/pmu/pmu.c
index 15b57988..35422e0d 100644
--- a/drivers/gpu/nvgpu/common/pmu/pmu.c
+++ b/drivers/gpu/nvgpu/common/pmu/pmu.c
@@ -357,7 +357,7 @@ static int nvgpu_pg_init_task(void *arg)
357 } 357 }
358 358
359 while (!nvgpu_thread_should_stop(&pg_init->state_task)) 359 while (!nvgpu_thread_should_stop(&pg_init->state_task))
360 nvgpu_msleep(5); 360 nvgpu_usleep_range(5000, 5100);
361 361
362 nvgpu_log_fn(g, "thread exit"); 362 nvgpu_log_fn(g, "thread exit");
363 363