Skip to contentSkip to conversation

drm/amdgpu: miss PRT case when bo update

PATCH In review Yintian Tao 3 participants 3 messages Mar 16, 2020

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

PATCH 1/1 drm/amdgpu: miss PRT case when bo update

Originally, only the PTE valid is taken in consider. The PRT case is missied when bo update which raise problem. We need add condition for PRT case.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -3
index 73398831196f..7a3e4514a00c 100644
@@ -1446,7 +1446,7 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
 		uint64_t incr, entry_end, pe_start;
 		struct amdgpu_bo *pt;
 
-		if (flags & AMDGPU_PTE_VALID) {
+		if (flags & (AMDGPU_PTE_VALID | AMDGPU_PTE_PRT)) {
 			/* make sure that the page tables covering the
 			 * address range are actually allocated
 			 */
@@ -1605,7 +1605,6 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 
 	if (flags & AMDGPU_PTE_VALID) {
 		struct amdgpu_bo *root = vm->root.base.bo;
-
 		if (!dma_fence_is_signaled(vm->last_direct))
 			amdgpu_bo_fence(root, vm->last_direct, true);
 
@@ -1718,7 +1717,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev,
 					AMDGPU_GPU_PAGES_IN_CPU_PAGE;
 			}
 
-		} else if (flags & AMDGPU_PTE_VALID) {
+		} else if (flags & (AMDGPU_PTE_VALID | AMDGPU_PTE_PRT)) {
 			addr += bo_adev->vm_manager.vram_base_offset;
 			addr += pfn << PAGE_SHIFT;
 		}
Signature · 6 lines
2.17.1

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

Am 16.03.20 um 08:52 schrieb Yintian Tao:

Quoted 3 lines

Originally, only the PTE valid is taken in consider. The PRT case is missied when bo update which raise problem. We need add condition for PRT case.

Good catch, just one style nit pick below.

Quoted 20 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index 73398831196f..7a3e4514a00c 100644
@@ -1446,7 +1446,7 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
  		uint64_t incr, entry_end, pe_start;
  		struct amdgpu_bo *pt;
 
-		if (flags & AMDGPU_PTE_VALID) {
+		if (flags & (AMDGPU_PTE_VALID | AMDGPU_PTE_PRT)) {
  			/* make sure that the page tables covering the
  			 * address range are actually allocated
  			 */

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, · line 1608

Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -1
@@ -1605,7 +1605,6 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
 
  	if (flags & AMDGPU_PTE_VALID) {
  		struct amdgpu_bo *root = vm->root.base.bo;
-
  		if (!dma_fence_is_signaled(vm->last_direct))

Please keep this empty line, it is required by the coding style guides.

With that fixed the patch is Reviewed-by: Christian König <[email protected]>.

Regards,
Christian.

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, · line 1723

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
  			amdgpu_bo_fence(root, vm->last_direct, true);
 
@@ -1718,7 +1717,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev,
  					AMDGPU_GPU_PAGES_IN_CPU_PAGE;
  			}
 
-		} else if (flags & AMDGPU_PTE_VALID) {
+		} else if (flags & (AMDGPU_PTE_VALID | AMDGPU_PTE_PRT)) {
  			addr += bo_adev->vm_manager.vram_base_offset;
  			addr += pfn << PAGE_SHIFT;
  		}

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

#2 lore raw

Hi Christian

Many thanks for your review

Best Regards
Yintian Tao

-----Original Message-----
From: Koenig, Christian <[email protected]>
Sent: 2020年3月16日 17:38
To: Tao, Yintian <[email protected]>; Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amdgpu: miss PRT case when bo update

Am 16.03.20 um 08:52 schrieb Yintian Tao:

Quoted 3 lines

Originally, only the PTE valid is taken in consider. The PRT case is missied when bo update which raise problem. We need add condition for PRT case.

Good catch, just one style nit pick below.

Quoted 21 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
index 73398831196f..7a3e4514a00c 100644
@@ -1446,7 +1446,7 @@ static int amdgpu_vm_update_ptes(struct amdgpu_vm_update_params *params,
  		uint64_t incr, entry_end, pe_start;
  		struct amdgpu_bo *pt;
 
-		if (flags & AMDGPU_PTE_VALID) {
+		if (flags & (AMDGPU_PTE_VALID | AMDGPU_PTE_PRT)) {
  			/* make sure that the page tables covering the
  			 * address range are actually allocated
  			 */

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_bo_update_mapping(struct · line 1609

Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -1
@@ -1605,7 +1605,6 @@ static int amdgpu_vm_bo_update_mapping(struct 
 amdgpu_device *adev,
 
  	if (flags & AMDGPU_PTE_VALID) {
  		struct amdgpu_bo *root = vm->root.base.bo;
-
  		if (!dma_fence_is_signaled(vm->last_direct))

Please keep this empty line, it is required by the coding style guides.

With that fixed the patch is Reviewed-by: Christian König <[email protected]>.

Regards,
Christian.

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, · line 1723

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
  			amdgpu_bo_fence(root, vm->last_direct, true);
@@ -1718,7 +1717,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev,
  					AMDGPU_GPU_PAGES_IN_CPU_PAGE;
  			}
 
-		} else if (flags & AMDGPU_PTE_VALID) {
+		} else if (flags & (AMDGPU_PTE_VALID | AMDGPU_PTE_PRT)) {
  			addr += bo_adev->vm_manager.vram_base_offset;
  			addr += pfn << PAGE_SHIFT;
  		}

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