]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu: Handle NULL bo->tbo.resource (again) in amdgpu_vm_bo_update
authorMichel Dänzer <mdaenzer@redhat.com>
Tue, 17 Dec 2024 17:22:56 +0000 (18:22 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 18 Dec 2024 18:02:03 +0000 (13:02 -0500)
Third time's the charm, I hope?

Fixes: d3116756a710 ("drm/ttm: rename bo->mem and make it a pointer")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3837
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 695c2c745e5dff201b75da8a1d237ce403600d04)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index ddd7f05e4db9ff2444f2ec90ede171fad0d81bbe..c9c48b782ec1b479471220e19aefe91bf60887c5 100644 (file)
@@ -1266,10 +1266,9 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
         * next command submission.
         */
        if (amdgpu_vm_is_bo_always_valid(vm, bo)) {
-               uint32_t mem_type = bo->tbo.resource->mem_type;
-
-               if (!(bo->preferred_domains &
-                     amdgpu_mem_type_to_domain(mem_type)))
+               if (bo->tbo.resource &&
+                   !(bo->preferred_domains &
+                     amdgpu_mem_type_to_domain(bo->tbo.resource->mem_type)))
                        amdgpu_vm_bo_evicted(&bo_va->base);
                else
                        amdgpu_vm_bo_idle(&bo_va->base);