From e153458aad399eedc2c05692226afb000dff4d58 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Wed, 6 Jan 2016 13:42:23 +0530 Subject: 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 Reviewed-on: http://git-master/r/929402 Reviewed-by: Sachin Nikam Tested-by: Sachin Nikam --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') 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, free_count = (q->size - (q->put - q->get) - 1) % q->size; if (size > free_count) - return -EAGAIN; + return -ENOSPC; e = kzalloc(sizeof(struct priv_cmd_entry), GFP_KERNEL); if (!e) { @@ -2022,7 +2022,7 @@ int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, if (err) { gk20a_err(d, "timeout waiting for gpfifo space"); - err = -EAGAIN; + err = -ENOSPC; goto clean_up; } -- cgit v1.2.2