diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2016-09-09 02:48:14 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-09-26 06:33:49 -0400 |
commit | 5c049b5c793a14a3cb936b23e503b07e6ac5c0d6 (patch) | |
tree | 0b3ef99e668ff663e74681bd17e14b57ef8f1e88 /drivers/gpu/nvgpu/boardobj | |
parent | 7b9bf036f44420d4cf74656481ba782de6689978 (diff) |
gpu: nvgpu: fix allocation and map size mismatch while mapping
It is possible to allocate larger size than user requested
e.g. If we allocate at 64k granularity, and user asks for
32k buffer, we end up allocating 64k chunk.
User still asks to map the buffer with size 32k and
hence we reserve mapping addresses only for 32k
But due to bug in mapping in update_gmmu_ptes_locked()
we end up creating mappings considering size of 64k
and corrupt some mappings
Fix this by considering min(chunk->length, map_size) while
mapping address range for a chunk
Also, map_size will be zero once we map all requested
address range. So bail out from the loop if map_size
is zero
Bug 1805064
Change-Id: I125d3ce261684dce7e679f9cb39198664f8937c4
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1217755
(cherry picked from commit 3ee1c6bc0718fb8dd9a28a37eff43a2872bdd5c0)
Reviewed-on: http://git-master/r/1221775
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/boardobj')
0 files changed, 0 insertions, 0 deletions