gpu: nvgpu: check gpfifo size against request

if a request is submitted larger than the
allocated fifo, an error is returned immediately
rather than waiting for timeout while enough space
becomes available in the fifo (timeout
will not trigger in this case)

bug 1563401

Change-Id: I264dee2673dc8722034881f9e7db7bb137a8c0c8
Signed-off-by: Sam Payne <spayne@nvidia.com>
Reviewed-on: http://git-master/r/665113
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Sam Payne
2014-12-17 10:02:53 -08:00
committed by Dan Willemsen
parent 7e9b9c0b3e
commit d1d1fbfb60

View File

@@ -1545,6 +1545,12 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
if (c->has_timedout)
return -ETIMEDOUT;
/* fifo not large enough for request. Return error immediately */
if (c->gpfifo.entry_num < num_entries) {
gk20a_err(d, "not enough gpfifo space allocated");
return -ENOMEM;
}
if ((flags & (NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_WAIT |
NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_GET)) &&
!fence)
@@ -1606,7 +1612,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
}
if (err) {
gk20a_err(d, "not enough gpfifo space");
gk20a_err(d, "timeout waiting for gpfifo space");
err = -EAGAIN;
goto clean_up;
}