drm/amdgpu: fix check in gmc_v9_0_get_vm_pte()
authorChristian König <christian.koenig@amd.com>
Thu, 31 Oct 2024 09:04:17 +0000 (10:04 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 11 Nov 2024 19:05:44 +0000 (14:05 -0500)
commit0e5ac88fb918297a7484b67f2b484d43bed3fbbe
tree8c7892ce3865af6aac5fca6f300f7908105cc3c8
parentdf0279e2a1c0735e8ca80c5df8d9f8f9fc120b4a
drm/amdgpu: fix check in gmc_v9_0_get_vm_pte()

The coherency flags can only be determined when the BO is locked and that
in turn is only guaranteed when the mapping is validated.

Fix the check, move the resource check into the function and add an assert
that the BO is locked.

Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes: d1a372af1c3d ("drm/amdgpu: Set MTYPE in PTE based on BO flags")
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 1b4ca8546f5b5c482717bedb8e031227b1541539)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c