diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2018-07-04 05:11:31 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-07-05 12:59:22 -0400 |
commit | c7e1f6fe9409975544890993626964278b2c925c (patch) | |
tree | 8cae9cd54139921b3d57694ac33739cdc9cce70b /drivers/gpu/nvgpu | |
parent | 7f09c477c9cb85c7571bab4bf87dac4a72f25696 (diff) |
gpu: nvgpu: fix pending bytes check for vidmem
In nvgpu_dma_alloc_flags_vid_at(), we check pending bytes of vidmem which are
yet to be cleared by reading g->mm.vidmem.bytes_pending.atomic_var
If there is something to be cleared we return EAGAIN otherwise we return ENOMEM
But to store above variable we use "int before_pending" which evaluates to zero
for sizes like 4GB and we end up returning ENOMEM instead of EAGAIN
Fix this by declaring before_pending variable as u64
Bug 200427361
Change-Id: I6ffe977e3663a5135fa17699ecafe78ac90d9314
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1770384
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/dma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/dma.c b/drivers/gpu/nvgpu/os/linux/dma.c index 51c8323a..6f17e284 100644 --- a/drivers/gpu/nvgpu/os/linux/dma.c +++ b/drivers/gpu/nvgpu/os/linux/dma.c | |||
@@ -329,7 +329,7 @@ int nvgpu_dma_alloc_flags_vid_at(struct gk20a *g, unsigned long flags, | |||
329 | struct nvgpu_allocator *vidmem_alloc = g->mm.vidmem.cleared ? | 329 | struct nvgpu_allocator *vidmem_alloc = g->mm.vidmem.cleared ? |
330 | &g->mm.vidmem.allocator : | 330 | &g->mm.vidmem.allocator : |
331 | &g->mm.vidmem.bootstrap_allocator; | 331 | &g->mm.vidmem.bootstrap_allocator; |
332 | int before_pending; | 332 | u64 before_pending; |
333 | 333 | ||
334 | if (nvgpu_mem_is_valid(mem)) { | 334 | if (nvgpu_mem_is_valid(mem)) { |
335 | nvgpu_warn(g, "memory leak !!"); | 335 | nvgpu_warn(g, "memory leak !!"); |