]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu: Return -EINVAL when MMSCH init status incorrect
authorLin.Cao <lincao12@amd.com>
Sun, 8 Oct 2023 09:36:40 +0000 (17:36 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 13 Oct 2023 14:58:48 +0000 (10:58 -0400)
Return -EINVAL when MMSCH init fail which can be handle by function
amdgpu_device_reset_sriov correctly.

Signed-off-by: Lin.Cao <lincao12@amd.com>
Reviewed-by: Jingwen Chen <Jingwen.Chen2@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c

index ac614b869aaf559cd99264ef765e4e7467774ddc..a3768aefb6b6244b6277726a0e70e7c58dfe0744 100644 (file)
@@ -518,8 +518,11 @@ static int jpeg_v4_0_start_sriov(struct amdgpu_device *adev)
                        return -EBUSY;
                }
        }
-       if (resp != expected && resp != MMSCH_VF_MAILBOX_RESP__INCOMPLETE && init_status != MMSCH_VF_ENGINE_STATUS__PASS)
+       if (resp != expected && resp != MMSCH_VF_MAILBOX_RESP__INCOMPLETE
+                       && init_status != MMSCH_VF_ENGINE_STATUS__PASS) {
                DRM_ERROR("MMSCH init status is incorrect! readback=0x%08x, header init status for jpeg: %x\n", resp, init_status);
+               return -EINVAL;
+       }
 
        return 0;