Re: [PATCH] drm/amdgpu: avoid restore process run into dead loop.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 2023-03-02 um 13:15 schrieb Gang Ba:
In restore process worker, pinned BO cause update PTE fail, then
the function re-schedule the restore_work. This will generate dead loop.

Signed-off-by: Gang Ba <gaba@xxxxxxx>

Reviewed-by: Felix Kuehling <Felix.Kuehling@xxxxxxx>


---
  drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index 4b46b936a804..a38be83e486e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -2586,7 +2586,7 @@ int amdgpu_amdkfd_gpuvm_export_ipc_obj(struct amdgpu_device *adev, void *vm,
  	struct dma_buf *dmabuf;
  	int r;
- if (!adev|| !vm || !mem)
+	if (!adev || !vm || !mem)
  		return -EINVAL;
mutex_lock(&mem->lock);
@@ -3170,6 +3170,9 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence **ef)
  			if (!attachment->is_mapped)
  				continue;
+ if (attachment->bo_va->base.bo->tbo.pin_count)
+				continue;
+
  			kfd_mem_dmaunmap_attachment(mem, attachment);
  			ret = update_gpuvm_pte(mem, attachment, &sync_obj);
  			if (ret) {



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux