]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: fix sdma firmware version error in sriov
authorKevin Wang <kevin1.wang@amd.com>
Mon, 31 May 2021 09:29:11 +0000 (17:29 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 2 Jun 2021 02:55:39 +0000 (22:55 -0400)
Re-adjust the function return order to avoid empty sdma version in the
sriov environment. (read amdgpu_firmware_info)

Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Stanley.Yang <Stanley.Yang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c

index deb907f960906d7c0269bed70a547a3e1bf936b8..98059bce692f795b5ba6a7d30e492110183509f0 100644 (file)
@@ -147,9 +147,6 @@ static int sdma_v5_2_init_microcode(struct amdgpu_device *adev)
        struct amdgpu_firmware_info *info = NULL;
        const struct common_firmware_header *header = NULL;
 
-       if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_SIENNA_CICHLID))
-               return 0;
-
        DRM_DEBUG("\n");
 
        switch (adev->asic_type) {
@@ -187,6 +184,9 @@ static int sdma_v5_2_init_microcode(struct amdgpu_device *adev)
                       (void *)&adev->sdma.instance[0],
                       sizeof(struct amdgpu_sdma_instance));
 
+       if (amdgpu_sriov_vf(adev) && (adev->asic_type == CHIP_SIENNA_CICHLID))
+               return 0;
+
        DRM_DEBUG("psp_load == '%s'\n",
                  adev->firmware.load_type == AMDGPU_FW_LOAD_PSP ? "true" : "false");