drm/amdgpu: skip RAS error injection in SRIOV
authorTao Zhou <tao.zhou1@amd.com>
Thu, 8 Dec 2022 03:51:47 +0000 (11:51 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Dec 2022 17:18:19 +0000 (12:18 -0500)
Injection on guest is not allowed.

v2: return directly in SRIOV environment.

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

index ad490c1e2f579bf86d3212323306f12b1d38ebbc..4e450e0b14fafd6760a5827c86beff541af2ef5e 100644 (file)
@@ -1087,6 +1087,10 @@ int amdgpu_ras_error_inject(struct amdgpu_device *adev,
                                                        info->head.block,
                                                        info->head.sub_block_index);
 
+       /* inject on guest isn't allowed, return success directly */
+       if (amdgpu_sriov_vf(adev))
+               return 0;
+
        if (!obj)
                return -EINVAL;