[AMD Official Use Only - General] Ok, will send this as the first. Emily Deng Best Wishes >-----Original Message----- >From: Christian König <ckoenig.leichtzumerken@xxxxxxxxx> >Sent: Friday, October 20, 2023 3:30 PM >To: Deng, Emily <Emily.Deng@xxxxxxx>; amd-gfx@xxxxxxxxxxxxxxxxxxxxx >Subject: Re: [PATCH 2/2] drm/amdgpu: handle the return for sync wait > >Am 20.10.23 um 08:13 schrieb Emily Deng: > >You need a patch description and this patch here needs to come first and not >second. > >Christian. > >> Signed-off-by: Emily Deng <Emily.Deng@xxxxxxx> >> --- >> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 9 ++++++--- >> drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 6 +++++- >> 2 files changed, 11 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c >> index 54f31a420229..3011c191d7dd 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c >> @@ -2668,7 +2668,7 @@ static int validate_invalid_user_pages(struct >> amdkfd_process_info *process_info) >> >> unreserve_out: >> ttm_eu_backoff_reservation(&ticket, &resv_list); >> - amdgpu_sync_wait(&sync, false); >> + ret = amdgpu_sync_wait(&sync, false); >> amdgpu_sync_free(&sync); >> out_free: >> kfree(pd_bo_list_entries); >> @@ -2939,8 +2939,11 @@ int >amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence >**ef) >> } >> >> /* Wait for validate and PT updates to finish */ >> - amdgpu_sync_wait(&sync_obj, false); >> - >> + ret = amdgpu_sync_wait(&sync_obj, false); >> + if (ret) { >> + pr_err("Failed to wait for validate and PT updates to finish\n"); >> + goto validate_map_fail; >> + } >> /* Release old eviction fence and create new one, because fence only >> * goes from unsignaled to signaled, fence cannot be reused. >> * Use context and mm from the old fence. >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c >> index 70fe3b39c004..a63139277583 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c >> @@ -1153,7 +1153,11 @@ int amdgpu_mes_ctx_map_meta_data(struct >amdgpu_device *adev, >> } >> amdgpu_sync_fence(&sync, vm->last_update); >> >> - amdgpu_sync_wait(&sync, false); >> + r = amdgpu_sync_wait(&sync, false); >> + if (r) { >> + DRM_ERROR("failed to wait sync\n"); >> + goto error; >> + } >> ttm_eu_backoff_reservation(&ticket, &list); >> >> amdgpu_sync_free(&sync);