diff options
author | Alex Waterman <alexw@nvidia.com> | 2018-03-05 22:03:32 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-03-08 07:27:39 -0500 |
commit | da9b549cd15b2f193a1c8b30f96d4106b28ddd30 (patch) | |
tree | 7d2a5f4c84b13cdd8d1b18bb69c2f7d103a5e32c /drivers/gpu/nvgpu/common/linux | |
parent | 4320877eb49ef16a5620536427f77de44bee12b7 (diff) |
gpu: nvgpu: Correctly plumb -EAGAIN from vidmem allocations
Userspace can and should retry vidmem allocations if there are pending
clears still to be executed by the GPU. But this requires the -EAGAIN
to properly propagate back to userspace.
Bug 200378648
Change-Id: Ib930711270439843e043d65c2e87b60612a76239
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1669099
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/vidmem.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/vidmem.c b/drivers/gpu/nvgpu/common/linux/vidmem.c index 1d9fea71..684262ba 100644 --- a/drivers/gpu/nvgpu/common/linux/vidmem.c +++ b/drivers/gpu/nvgpu/common/linux/vidmem.c | |||
@@ -173,6 +173,8 @@ int nvgpu_vidmem_export_linux(struct gk20a *g, size_t bytes) | |||
173 | if (!gk20a_get(g)) | 173 | if (!gk20a_get(g)) |
174 | return -ENODEV; | 174 | return -ENODEV; |
175 | 175 | ||
176 | vidmem_dbg(g, "Allocating vidmem buf: %zu bytes", bytes); | ||
177 | |||
176 | priv = nvgpu_kzalloc(g, sizeof(*priv)); | 178 | priv = nvgpu_kzalloc(g, sizeof(*priv)); |
177 | if (!priv) { | 179 | if (!priv) { |
178 | err = -ENOMEM; | 180 | err = -ENOMEM; |
@@ -180,8 +182,8 @@ int nvgpu_vidmem_export_linux(struct gk20a *g, size_t bytes) | |||
180 | } | 182 | } |
181 | 183 | ||
182 | buf = nvgpu_vidmem_user_alloc(g, bytes); | 184 | buf = nvgpu_vidmem_user_alloc(g, bytes); |
183 | if (!buf) { | 185 | if (IS_ERR(buf)) { |
184 | err = -ENOMEM; | 186 | err = PTR_ERR(buf); |
185 | goto fail; | 187 | goto fail; |
186 | } | 188 | } |
187 | 189 | ||