From 2dac5936e50084e42354c50b3d9723f5f0a2eb63 Mon Sep 17 00:00:00 2001 From: Rex Zhu Date: Mon, 12 Mar 2018 19:53:01 +0800 Subject: [PATCH] drm/amdgpu: Call amdgpu_ucode_fini_bo in amd_powerplay.c make it symmetric with amdgpu_ucode_init_bo in amd_powerplay.c refine the "commit b22558bb4ff8fc9fe925222f90297d7a03a5fb20" Reviewed-by: Alex Deucher Reviewed-by: Evan Quan Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 --- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 8 +++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 218f0ef..690cf77 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -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; diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c index a5bc52c..3da3dcc 100644 --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c @@ -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); } -- 2.7.4