drm/amd/powerplay: smu needs to be initialized after rlc in direct mode
authorHuang Rui <ray.huang@amd.com>
Wed, 20 Feb 2019 12:05:11 +0000 (20:05 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 21 Jun 2019 23:59:24 +0000 (18:59 -0500)
For gfx 10, rlc firmware loading relies on smu firmware is loaded firstly, so in
direct type, it has to load smc ucode here before rlc. And meanwhile, the smu
initialization has to move after rlc, otherwise, smu message will get failure
during the handshake with rlc and smu.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

index 88fd79d5aca654619b32123a3f2ad5c9d683c693..b9b56ec1aacf043c41515a1a60b4986c63989629 100644 (file)
@@ -820,16 +820,12 @@ static int smu_hw_init(void *handle)
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        struct smu_context *smu = &adev->smu;
 
-       if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) {
-               ret = smu_load_microcode(smu);
-               if (ret)
+       if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
+               ret = smu_check_fw_status(smu);
+               if (ret) {
+                       pr_err("SMC firmware status is not correct\n");
                        return ret;
-       }
-
-       ret = smu_check_fw_status(smu);
-       if (ret) {
-               pr_err("SMC firmware status is not correct\n");
-               return ret;
+               }
        }
 
        mutex_lock(&smu->mutex);