Skip to contentSkip to conversation

drm/amdgpu: skip unallocated PDs/PTs while invalidating

PATCH In review Christian König 2 participants 2 messages Jan 16, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: skip unallocated PDs/PTs while invalidating

We don't need to return an error in this case.

Fixes d6932a4d86e4 drm/amdgpu: make sure to never allocate PDs/PTs for invalidations
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +6 -2
index 5cb182231f5d..6cf407aab279 100644
@@ -1467,8 +1467,12 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
 			 * smaller than the address shift. Go to the next
 			 * child entry and try again.
 			 */
-			if (!amdgpu_vm_pt_descendant(adev, &cursor))
-				return -ENOENT;
+			if (!amdgpu_vm_pt_descendant(adev, &cursor)) {
+				if (flags & AMDGPU_PTE_VALID)
+					return -ENOENT;
+				else
+					amdgpu_vm_pt_next(adev, &cursor);
+			}
 			continue;
 		} else if (frag >= parent_shift) {
 			/* If the fragment size is even larger than the parent
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw

I'll test it out in a minute.

Tom

Quoted 17 lines · Christian König

We don't need to return an error in this case.

Fixes d6932a4d86e4 drm/amdgpu: make sure to never allocate PDs/PTs for invalidations
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -1
index 5cb182231f5d..6cf407aab279 100644
@@ -1467,8 +1467,12 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
  			 * smaller than the address shift. Go to the next
  			 * child entry and try again.
  			 */
-			if (!amdgpu_vm_pt_descendant(adev, &cursor))

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params, · line 1478

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +6 -1
-				return -ENOENT;
+			if (!amdgpu_vm_pt_descendant(adev, &cursor)) {
+				if (flags & AMDGPU_PTE_VALID)
+					return -ENOENT;
+				else
+					amdgpu_vm_pt_next(adev, &cursor);
+			}
  			continue;
  		} else if (frag >= parent_shift) {
  			/* If the fragment size is even larger than the parent

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx