mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
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
This commit is contained in:
committed by
mobile promotions
parent
8dc75c1725
commit
2535c81c6c
@@ -337,12 +337,12 @@ int __gk20a_do_idle(struct gk20a *g, bool force_reset)
|
||||
|
||||
/* check and wait until GPU is idle (with a timeout) */
|
||||
do {
|
||||
nvgpu_msleep(1);
|
||||
nvgpu_usleep_range(1000, 1100);
|
||||
ref_cnt = atomic_read(&dev->power.usage_count);
|
||||
} while (ref_cnt != target_ref_cnt && !nvgpu_timeout_expired(&timeout));
|
||||
|
||||
if (ref_cnt != target_ref_cnt) {
|
||||
nvgpu_err(g, "failed to idle - refcount %d != 1",
|
||||
nvgpu_err(g, "failed to idle - refcount %d != target_ref_cnt",
|
||||
ref_cnt);
|
||||
goto fail_drop_usage_count;
|
||||
}
|
||||
@@ -367,7 +367,7 @@ int __gk20a_do_idle(struct gk20a *g, bool force_reset)
|
||||
|
||||
/* check in loop if GPU is railgated or not */
|
||||
do {
|
||||
nvgpu_msleep(1);
|
||||
nvgpu_usleep_range(1000, 1100);
|
||||
is_railgated = platform->is_railgated(dev);
|
||||
} while (!is_railgated && !nvgpu_timeout_expired(&timeout));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user