drm/amd/pp: Allocate ucode bo in request_smu_load_fw
authorRex Zhu <Rex.Zhu@amd.com>
Sat, 29 Sep 2018 07:42:52 +0000 (15:42 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Oct 2018 22:08:04 +0000 (17:08 -0500)
ucode bo is needed by request_smu_load_fw,
the request_smu_load_fw maybe called by gfx/sdma
before smu hw init.
so move amdgpu_ucode_bo_init to request_smu_lowd_fw
from smu hw init.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/amd_powerplay.c
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c
drivers/gpu/drm/amd/powerplay/smumgr/smu8_smumgr.c

index e51d961a94b203539a32bad0e8fe95ba5dcf651f..b2ebcb1457b57bee81eb1d921298e31418b54906 100644 (file)
@@ -124,9 +124,6 @@ static int pp_hw_init(void *handle)
        struct amdgpu_device *adev = handle;
        struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
 
-       if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU)
-               amdgpu_ucode_init_bo(adev);
-
        ret = hwmgr_hw_init(hwmgr);
 
        if (ret)
index 794a1657eaa9a473da77a8fc6465f77d290228f6..99b4e4f6a2eb06a71f22854bf440949459a4500e 100644 (file)
@@ -346,6 +346,8 @@ int smu7_request_smu_load_fw(struct pp_hwmgr *hwmgr)
        if (!hwmgr->reload_fw)
                return 0;
 
+       amdgpu_ucode_init_bo(hwmgr->adev);
+
        if (smu_data->soft_regs_start)
                cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,
                                        smu_data->soft_regs_start + smum_get_offsetof(hwmgr,
index 7b3b66d2f04783af52b7fd9b77ad3171f7376738..abbf2f285aab025c8b99af82541b9d0ba8295ebf 100644 (file)
@@ -664,6 +664,8 @@ static int smu8_request_smu_load_fw(struct pp_hwmgr *hwmgr)
        if (!hwmgr->reload_fw)
                return 0;
 
+       amdgpu_ucode_init_bo(hwmgr->adev);
+
        smu8_smu_populate_firmware_entries(hwmgr);
 
        smu8_smu_construct_toc(hwmgr);