drm/amdgpu: fix nullptr error of amdgpu_vm_handle_moved
Subsystems (3)
PATCH 1/1 drm/amdgpu: fix nullptr error of amdgpu_vm_handle_moved
If a amdgpu_bo_va is fpriv->prt_va, the bo of this one is always NULL. So, such kind of amdgpu_bo_va should be updated separately before amdgpu_vm_handle_moved.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +14 -1
@@ -2970,9 +2970,22 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence __rcu *struct amdgpu_device *adev =amdgpu_ttm_adev ( peer_vm->root.bo->tbo.bdev); +struct amdgpu_fpriv *fpriv = + container_of(peer_vm, struct amdgpu_fpriv, vm); + + ret =amdgpu_vm_bo_update (adev, fpriv->prt_va, false); +if (ret) { +dev_dbg (adev->dev, +"Memory eviction: handle PRT moved failed, pid %8d. Try again.\n" , +pid_nr (process_info->pid)); + goto validate_map_fail; + } + ret =amdgpu_vm_handle_moved (adev, peer_vm, &exec.ticket);if (ret) { -pr_debug ("Memory eviction: handle moved failed. Try again\n" ); +dev_dbg (adev->dev, +"Memory eviction: handle moved failed, pid %8d. Try again.\n" , +pid_nr (process_info->pid)); goto validate_map_fail; } }
Signature · 1 line
2.43.0
[Public]
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Heng Zhou
Sent: Friday, August 8, 2025 6:32 AM
To: [email protected]
Cc: Lazar, Lijo <[email protected]>; Koenig, Christian <[email protected]>; Deng, Emily <[email protected]>; Zhao, Victor <[email protected]>; Kuehling, Felix <[email protected]>; [email protected]; Ma, Qing (Mark) <[email protected]>; Zhou, Heng <[email protected]>
Subject: [PATCH] drm/amdgpu: fix nullptr error of amdgpu_vm_handle_moved
If a amdgpu_bo_va is fpriv->prt_va, the bo of this one is always NULL. So, such kind of amdgpu_bo_va should be updated separately before amdgpu_vm_handle_moved.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +14 -1
@@ -2970,9 +2970,22 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence __rcu *struct amdgpu_device *adev =amdgpu_ttm_adev ( peer_vm->root.bo->tbo.bdev); +struct amdgpu_fpriv *fpriv = + container_of(peer_vm, struct amdgpu_fpriv, vm); + + ret =amdgpu_vm_bo_update (adev, fpriv->prt_va, false); +if (ret) { +dev_dbg (adev->dev, +"Memory eviction: handle PRT moved failed, pid %8d. Try again.\n" , +pid_nr (process_info->pid)); + goto validate_map_fail; + } + ret =amdgpu_vm_handle_moved (adev, peer_vm, &exec.ticket);if (ret) { -pr_debug ("Memory eviction: handle moved failed. Try again\n" ); +dev_dbg (adev->dev, +"Memory eviction: handle moved failed, pid %8d. Try again.\n" , +pid_nr (process_info->pid)); goto validate_map_fail; } }
--
2.43.0