All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: make sure to only process the remaining VM range
@ 2021-03-15 12:58 Christian König
  0 siblings, 0 replies; only message in thread
From: Christian König @ 2021-03-15 12:58 UTC (permalink / raw)
  To: Felix.Kuehling, Guchun.Chen, amd-gfx

We should only map the remaining size here and not the whole segment.

Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes: 3af0a018a728 ("drm/amdgpu: new resource cursor")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 318eeea577b5..ad1698bd6b24 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1646,7 +1646,8 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 	while (cursor.remaining) {
 		uint64_t tmp, num_entries, addr;
 
-		num_entries = cursor.size >> AMDGPU_GPU_PAGE_SHIFT;
+		num_entries = min(cursor.size, cursor.remaining)
+			>> AMDGPU_GPU_PAGE_SHIFT;
 		if (pages_addr) {
 			bool contiguous = true;
 
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-15 12:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15 12:58 [PATCH] drm/amdgpu: make sure to only process the remaining VM range Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.