drm/amdgpu: Call amdgpu_ucode_fini_bo in amd_powerplay.c
authorRex Zhu <Rex.Zhu@amd.com>
Mon, 12 Mar 2018 11:53:01 +0000 (19:53 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Mar 2018 14:57:58 +0000 (09:57 -0500)
make it symmetric with amdgpu_ucode_init_bo in amd_powerplay.c

refine the "commit b22558bb4ff8fc9fe925222f90297d7a03a5fb20"

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
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/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/powerplay/amd_powerplay.c

index 218f0efa39fb30e203bd01a5794f057d0e416dce..690cf77b950eb8bb54a10f600b2449cc1c614bd9 100644 (file)
@@ -1489,9 +1489,6 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
        }
 
        for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
-               if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC &&
-                       adev->firmware.load_type == AMDGPU_FW_LOAD_SMU)
-                       amdgpu_ucode_fini_bo(adev);
                if (!adev->ip_blocks[i].status.hw)
                        continue;
 
index a5bc52cdc40dbb12faa2f8decda75d265fc7d701..3da3dccd13e2a03084e3f0ad308b7fb8ba089fd6 100644 (file)
@@ -134,6 +134,10 @@ static int pp_sw_fini(void *handle)
                if (hwmgr->smumgr_funcs->smu_fini != NULL)
                        hwmgr->smumgr_funcs->smu_fini(hwmgr);
        }
+
+       if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU)
+               amdgpu_ucode_fini_bo(adev);
+
        return 0;
 }
 
@@ -201,7 +205,9 @@ static int pp_late_init(void *handle)
 
 static void pp_late_fini(void *handle)
 {
-       amd_powerplay_destroy(handle);
+       struct amdgpu_device *adev = handle;
+
+       amd_powerplay_destroy(adev);
 }