mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: keep gpu busy during vab reserve/flush ioctls
VAB IOCTL for reserve and flush can take more than railgate_delay(500msec). To avoid gpu entering into railgate, set gpu busy hint during entry and set to idle at the end of ioctl. Bug 3468562 Change-Id: I9219e65004ad42028062ce09a315d9fde029a86c Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2643418 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
54adf26042
commit
820d2b4a2d
@@ -789,11 +789,18 @@ static int nvgpu_prof_ioctl_vab_reserve(struct nvgpu_profiler_object *prof,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = gk20a_busy(g);
|
||||||
|
if (err != 0) {
|
||||||
|
nvgpu_err(g, "failed to poweron");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
ckr = nvgpu_kzalloc(g, sizeof(struct nvgpu_vab_range_checker) *
|
ckr = nvgpu_kzalloc(g, sizeof(struct nvgpu_vab_range_checker) *
|
||||||
arg->num_range_checkers);
|
arg->num_range_checkers);
|
||||||
if (copy_from_user(ckr, user_ckr,
|
if (copy_from_user(ckr, user_ckr,
|
||||||
sizeof(struct nvgpu_vab_range_checker) *
|
sizeof(struct nvgpu_vab_range_checker) *
|
||||||
arg->num_range_checkers)) {
|
arg->num_range_checkers)) {
|
||||||
|
gk20a_idle(g);
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -801,6 +808,8 @@ static int nvgpu_prof_ioctl_vab_reserve(struct nvgpu_profiler_object *prof,
|
|||||||
|
|
||||||
nvgpu_kfree(g, ckr);
|
nvgpu_kfree(g, ckr);
|
||||||
|
|
||||||
|
gk20a_idle(g);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -811,6 +820,12 @@ static int nvgpu_prof_ioctl_vab_flush(struct nvgpu_profiler_object *prof,
|
|||||||
struct gk20a *g = prof->g;
|
struct gk20a *g = prof->g;
|
||||||
u64 *user_data = nvgpu_kzalloc(g, arg->buffer_size);
|
u64 *user_data = nvgpu_kzalloc(g, arg->buffer_size);
|
||||||
|
|
||||||
|
err = gk20a_busy(g);
|
||||||
|
if (err != 0) {
|
||||||
|
nvgpu_err(g, "failed to poweron");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
err = g->ops.fb.vab.dump_and_clear(g, user_data, arg->buffer_size);
|
err = g->ops.fb.vab.dump_and_clear(g, user_data, arg->buffer_size);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
goto fail;
|
goto fail;
|
||||||
@@ -824,6 +839,7 @@ static int nvgpu_prof_ioctl_vab_flush(struct nvgpu_profiler_object *prof,
|
|||||||
|
|
||||||
fail:
|
fail:
|
||||||
nvgpu_kfree(g, user_data);
|
nvgpu_kfree(g, user_data);
|
||||||
|
gk20a_idle(g);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user