drm/amdgpu: fix offset calculation amdgpu_vm_bo_clear_mappings()
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix offset calculation amdgpu_vm_bo_clear_mappings()
Offset calculation wasn't correct as start addresses are in pfn not in bytes.
Signed-off-by Nirmoy Das <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
@@ -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);
Signature · 6 lines
2.30.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
maintainerAm 26.03.21 um 16:25 schrieb Nirmoy Das:
Quoted 4 lines
Offset calculation wasn't correct as start addresses are in pfn not in bytes.
Signed-off-by Nirmoy Das <[email protected]>
Wow that code has been around for a while without noticing this. Really good catch.
Patch is Reviewed-by: Christian König <[email protected]>
CC: [email protected]
Quoted 9 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev, · line 2416
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-1@@ -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);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx