From: Tvrtko Ursulin Date: Tue, 24 Sep 2024 09:51:45 +0000 (+0100) Subject: drm/amdgpu: Remove the while loop from amdgpu_job_prepare_job X-Git-Tag: microblaze-v6.16~490^2~20^2~107 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=89cfa73b612a711ad19c6323814f4d28535a0fca;p=linux-2.6-microblaze.git drm/amdgpu: Remove the while loop from amdgpu_job_prepare_job While loop makes it sound like amdgpu_vmid_grab() potentially needs to be called multiple times to produce a fence, while in reality all code paths either return an error, assign a valid job->vmid or assign a vmid which will be valid once the returned fence signals. Therefore we can remove the loop to make it clear the call does not need to be repeated. Reviewed-by: Christian König Signed-off-by: Tvrtko Ursulin Cc: Christian König Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c index b550a31f4457..102742f1faa2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c @@ -359,7 +359,7 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job, if (job->gang_submit) fence = amdgpu_device_switch_gang(ring->adev, job->gang_submit); - while (!fence && job->vm && !job->vmid) { + if (!fence && job->vm && !job->vmid) { r = amdgpu_vmid_grab(job->vm, ring, job, &fence); if (r) { dev_err(ring->adev->dev, "Error getting VM ID (%d)\n", r);