]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: Retain job->vm in amdgpu_job_prepare_job
authorYuanShang <YuanShang.Mao@amd.com>
Wed, 23 Jul 2025 08:44:49 +0000 (16:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:34:30 +0000 (16:34 +0200)
commit c00d8b79fd2167c6ac65e096619535acdf8678d5 upstream.

The field 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.

Specifically, function amdgpu_vm_generation checks if the VM is valid for this job to use.
For instance, if a gfx job depends on a cancelled sdma job from entity vm->delayed,
then the gfx job should be skipped.

Fixes: 26c95e838e63 ("drm/amdgpu: set the VM pointer to NULL in amdgpu_job_prepare")
Signed-off-by: YuanShang <YuanShang.Mao@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit ed76936c6b10b547c6df4ca75412331e9ef6d339)
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c

index 3528a27c7c1ddd924ddf3c87d53ee6a92850905f..bee6609eab204393d934f5057e2416c7f5ee845c 100644 (file)
@@ -387,13 +387,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;
        }