drm/amd/amdgpu: reserve vm invalidation engine for firmware
authorJack Xiao <Jack.Xiao@amd.com>
Wed, 16 Nov 2022 08:44:21 +0000 (16:44 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 21 Nov 2022 21:43:13 +0000 (16:43 -0500)
If mes enabled, reserve VM invalidation engine 5 for firmware.

Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.0.x
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c

index b06cb0b..28612e5 100644 (file)
@@ -479,6 +479,12 @@ int amdgpu_gmc_allocate_vm_inv_eng(struct amdgpu_device *adev)
        unsigned i;
        unsigned vmhub, inv_eng;
 
+       if (adev->enable_mes) {
+               /* reserve engine 5 for firmware */
+               for (vmhub = 0; vmhub < AMDGPU_MAX_VMHUBS; vmhub++)
+                       vm_inv_engs[vmhub] &= ~(1 << 5);
+       }
+
        for (i = 0; i < adev->num_rings; ++i) {
                ring = adev->rings[i];
                vmhub = ring->funcs->vmhub;