diff options
author | Sam Payne <spayne@nvidia.com> | 2014-12-17 13:02:53 -0500 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-04-04 18:06:17 -0400 |
commit | d1d1fbfb60141f25cad3206f0da974b78c651e71 (patch) | |
tree | 684cb3fa16845bfc80c90cb5457a3f3ca7480455 /drivers/gpu | |
parent | 7e9b9c0b3ea832d9f372663c81e526a70fb65f92 (diff) |
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 28b0bbc7..a54e3a6c 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -1545,6 +1545,12 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
1545 | if (c->has_timedout) | 1545 | if (c->has_timedout) |
1546 | return -ETIMEDOUT; | 1546 | return -ETIMEDOUT; |
1547 | 1547 | ||
1548 | /* fifo not large enough for request. Return error immediately */ | ||
1549 | if (c->gpfifo.entry_num < num_entries) { | ||
1550 | gk20a_err(d, "not enough gpfifo space allocated"); | ||
1551 | return -ENOMEM; | ||
1552 | } | ||
1553 | |||
1548 | if ((flags & (NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_WAIT | | 1554 | if ((flags & (NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_WAIT | |
1549 | NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_GET)) && | 1555 | NVGPU_SUBMIT_GPFIFO_FLAGS_FENCE_GET)) && |
1550 | !fence) | 1556 | !fence) |
@@ -1606,7 +1612,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, | |||
1606 | } | 1612 | } |
1607 | 1613 | ||
1608 | if (err) { | 1614 | if (err) { |
1609 | gk20a_err(d, "not enough gpfifo space"); | 1615 | gk20a_err(d, "timeout waiting for gpfifo space"); |
1610 | err = -EAGAIN; | 1616 | err = -EAGAIN; |
1611 | goto clean_up; | 1617 | goto clean_up; |
1612 | } | 1618 | } |