mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
gpu: nvgpu: disallow invalid syncpoint wait ids
Instead of ignoring a wait when a raw syncpoint prefence has an invalid id, reject the submit with -EINVAL just like with syncpoints in syncfds. Change-Id: I9b5c417bd1c7cd081c79659d088ac2c915de8c0e Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1680281 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
bac51e8081
commit
cb8d8337a6
@@ -462,11 +462,8 @@ static int gk20a_submit_prepare_syncs(struct channel_gk20a *c,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Optionally insert syncpt wait in the beginning of gpfifo submission
|
* Optionally insert syncpt/semaphore wait in the beginning of gpfifo
|
||||||
* when user requested and the wait hasn't expired. Validate that the id
|
* submission when user requested and the wait hasn't expired.
|
||||||
* makes sense, elide if not. The only reason this isn't being
|
|
||||||
* unceremoniously killed is to keep running some tests which trigger
|
|
||||||
* this condition.
|
|
||||||
*/
|
*/
|
||||||
if (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_WAIT) {
|
if (flags & NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_WAIT) {
|
||||||
int max_wait_cmds = c->deterministic ? 1 : 0;
|
int max_wait_cmds = c->deterministic ? 1 : 0;
|
||||||
|
|||||||
@@ -58,10 +58,8 @@ static int gk20a_channel_syncpt_wait_syncpt(struct gk20a_channel_sync *s,
|
|||||||
struct channel_gk20a *c = sp->c;
|
struct channel_gk20a *c = sp->c;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
if (!nvgpu_nvhost_syncpt_is_valid_pt_ext(sp->nvhost_dev, id)) {
|
if (!nvgpu_nvhost_syncpt_is_valid_pt_ext(sp->nvhost_dev, id))
|
||||||
nvgpu_warn(c->g, "invalid wait id in gpfifo submit, elided");
|
return -EINVAL;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nvgpu_nvhost_syncpt_is_expired_ext(sp->nvhost_dev, id, thresh))
|
if (nvgpu_nvhost_syncpt_is_expired_ext(sp->nvhost_dev, id, thresh))
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user