]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
drm/amd/pp: Use release_firmware directly in powerplay
authorRex Zhu <Rex.Zhu@amd.com>
Thu, 22 Mar 2018 11:32:45 +0000 (19:32 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 11 Apr 2018 18:07:49 +0000 (13:07 -0500)
Use kernel api directly so we can deprecate the cgs interface.

Reviewed-by: Alex Deucher <alexander.deucher@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/ci_smumgr.c
drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c

index 337af789d258a7fc9c0555dacd07850178becd5c..b91ef113a49003669f0ff3251954fbfee006def0 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/kernel.h>
 #include <linux/gfp.h>
 #include <linux/slab.h>
+#include <linux/firmware.h>
 #include "amd_shared.h"
 #include "amd_powerplay.h"
 #include "power_state.h"
@@ -107,8 +108,11 @@ static int pp_sw_fini(void *handle)
 
        hwmgr_sw_fini(hwmgr);
 
-       if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU)
+       if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU) {
+               release_firmware(adev->pm.fw);
+               adev->pm.fw = NULL;
                amdgpu_ucode_fini_bo(adev);
+       }
 
        return 0;
 }
index 08d000140ecabfcac8d781f656bada1ed35c6d17..e30a2eea1fba0fa8a1e4c661c2830d314abd9a67 100644 (file)
@@ -2784,7 +2784,6 @@ static int ci_smu_fini(struct pp_hwmgr *hwmgr)
 {
        kfree(hwmgr->smu_backend);
        hwmgr->smu_backend = NULL;
-       cgs_rel_firmware(hwmgr->device, CGS_UCODE_ID_SMU);
        return 0;
 }
 
index 3684822b75b289cdc3ac68990a41a11e3f0878cb..41fab2df994e06b5d0d6122aa42c1d87cdf198c3 100644 (file)
@@ -650,6 +650,5 @@ int smu7_smu_fini(struct pp_hwmgr *hwmgr)
 
        kfree(hwmgr->smu_backend);
        hwmgr->smu_backend = NULL;
-       cgs_rel_firmware(hwmgr->device, CGS_UCODE_ID_SMU);
        return 0;
 }