[AMD Official Use Only - AMD Internal Distribution Only]

Hi Alexander

        Since Christian is on vacation. Could you help review the below patch?
        If set job->vm to null in amdgpu_job_prepare_job, the job which should 
be skipped in amdgpu_job_run will be submitted unexpectedly.

Thanks
River


-----Original Message-----
From: YuanShang Mao (River) <yuanshang....@amd.com>
Sent: Wednesday, July 23, 2025 5:06 PM
To: amd-gfx@lists.freedesktop.org
Cc: Koenig, Christian <christian.koe...@amd.com>; YuanShang Mao (River) 
<yuanshang....@amd.com>
Subject: [PATCH] drm/amdgpu: keep job->vm in amdgpu_job_prepare_job

job->vm is used in function amdgpu_job_run to get the page
table re-generation counter and decide whether the job should be skipped.

Signed-off-by: YuanShang <yuanshang....@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index 45febdc2f349..18998343815e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -360,13 +360,6 @@ amdgpu_job_prepare_job(struct drm_sched_job *sched_job,
                        dev_err(ring->adev->dev, "Error getting VM ID (%d)\n", 
r);
                        goto error;
                }
-               /*
-                * The VM structure might be released after the VMID is
-                * assigned, we had multiple problems with people trying to use
-                * the VM pointer so better set it to NULL.
-                */
-               if (!fence)
-                       job->vm = NULL;
                return fence;
        }

--
2.25.1

Reply via email to