summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a_allocator_page.c
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2016-09-05 07:58:23 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-09-14 17:13:40 -0400
commit6029684eb0e9d2def2b0c12cbfba90c24b99369f (patch)
treefe459edc189353d6c44cbc99ae14ec447cbfc401 /drivers/gpu/nvgpu/gk20a/gk20a_allocator_page.c
parent93d31990197897471e291d83361d9d57769cd6f2 (diff)
gpu: nvgpu: fix chunk size mismatch in page allocator
When allocating discontiguous memory composed of several chunks, update also the number of pages used by the current chunk, if a large chunk was not available and a retry is performed with a smaller one. Failing to do this would result in too few chunks reserved for a large enough allocation in certain conditions. Bug 1805067 Change-Id: I9d14864724d228b42c47eb4669fbe0f789334397 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1214914 (cherry picked from commit 9bece931b13e4dad808622462d4d98d421cfb383) Reviewed-on: http://git-master/r/1220546 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_allocator_page.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_allocator_page.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_page.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_page.c
index 521a87b3..07e3d823 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_page.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_page.c
@@ -168,6 +168,8 @@ static struct gk20a_page_alloc *__gk20a_alloc_pages(
168 } 168 }
169 } while (!chunk_addr && chunk_len >= a->page_size); 169 } while (!chunk_addr && chunk_len >= a->page_size);
170 170
171 chunk_pages = chunk_len >> a->page_shift;
172
171 if (!chunk_addr) { 173 if (!chunk_addr) {
172 palloc_dbg(a, "bailing @ 0x%llx\n", chunk_len); 174 palloc_dbg(a, "bailing @ 0x%llx\n", chunk_len);
173 goto fail_cleanup; 175 goto fail_cleanup;