summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2016-01-06 03:12:23 -0500
committerSachin Nikam <snikam@nvidia.com>2016-01-13 02:23:43 -0500
commite153458aad399eedc2c05692226afb000dff4d58 (patch)
tree16fd705a75920f1659b76f14a6fe3ff60560da2b /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parentf7285577d7948115ff38c83982eb3b126302b195 (diff)
gpu: nvgpu: return ENOSPC if no private command buffer space
If we run out of gpfifo space or private command buffer space, we currently return EAGAIN as error code Instead of EAGAIN, return ENOSPC as error code so that caller (user space) can read the error code and do some re-trials As the jobs are processed, it is possible to free up some space. And hence such re-trials could succeed Bug 1715291 Change-Id: I9a2ed7134d2496b383899b3c02c0e70452b26115 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/929402 Reviewed-by: Sachin Nikam <snikam@nvidia.com> Tested-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 2ec1ffe4..f34df520 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -1327,7 +1327,7 @@ int gk20a_channel_alloc_priv_cmdbuf(struct channel_gk20a *c, u32 orig_size,
1327 free_count = (q->size - (q->put - q->get) - 1) % q->size; 1327 free_count = (q->size - (q->put - q->get) - 1) % q->size;
1328 1328
1329 if (size > free_count) 1329 if (size > free_count)
1330 return -EAGAIN; 1330 return -ENOSPC;
1331 1331
1332 e = kzalloc(sizeof(struct priv_cmd_entry), GFP_KERNEL); 1332 e = kzalloc(sizeof(struct priv_cmd_entry), GFP_KERNEL);
1333 if (!e) { 1333 if (!e) {
@@ -2022,7 +2022,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c,
2022 2022
2023 if (err) { 2023 if (err) {
2024 gk20a_err(d, "timeout waiting for gpfifo space"); 2024 gk20a_err(d, "timeout waiting for gpfifo space");
2025 err = -EAGAIN; 2025 err = -ENOSPC;
2026 goto clean_up; 2026 goto clean_up;
2027 } 2027 }
2028 2028