drm/amdgpu: fix offset calculation in amdgpu_vm_bo_clear_mappings()
authorNirmoy Das <nirmoy.das@amd.com>
Fri, 26 Mar 2021 15:08:10 +0000 (16:08 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Apr 2021 20:47:02 +0000 (16:47 -0400)
Offset calculation wasn't correct as start addresses are in pfn
not in bytes.

Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index abb3ab0..91b3320 100644 (file)
@@ -2410,7 +2410,7 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev,
                        after->start = eaddr + 1;
                        after->last = tmp->last;
                        after->offset = tmp->offset;
-                       after->offset += after->start - tmp->start;
+                       after->offset += (after->start - tmp->start) << PAGE_SHIFT;
                        after->flags = tmp->flags;
                        after->bo_va = tmp->bo_va;
                        list_add(&after->list, &tmp->bo_va->invalids);