drm/amdgpu: fix smu ucode memleak (v2)
authorMonk Liu <Monk.Liu@amd.com>
Tue, 31 May 2016 05:44:48 +0000 (13:44 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 9 Jun 2016 14:49:14 +0000 (10:49 -0400)
Properly release the smu ucode in powerplay.

v2: agd: add polaris as well

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c
drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c
drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c

index 0ac8642002838fb734ba4674bd88bce9a9067feb..8e52a2e82db58c4de3ffc7ff3903bbabec037f4a 100644 (file)
@@ -1014,6 +1014,8 @@ static int fiji_smu_fini(struct pp_smumgr *smumgr)
                kfree(smumgr->backend);
                smumgr->backend = NULL;
        }
+
+       cgs_rel_firmware(smumgr->device, CGS_UCODE_ID_SMU);
        return 0;
 }
 
index de618ead9db8df73e10ee0da9dac0cad940049b3..043b6ac09d5f6a73c09a4ecf8edf0ceca34f4c7f 100644 (file)
@@ -469,6 +469,7 @@ int polaris10_smu_fini(struct pp_smumgr *smumgr)
                kfree(smumgr->backend);
                smumgr->backend = NULL;
        }
+       cgs_rel_firmware(smumgr->device, CGS_UCODE_ID_SMU);
        return 0;
 }
 
index 70d3ecf27bdef74658b85d4db525e01cf82b4d2a..b22722eabafcbc53477dd284a2671326443ec011 100644 (file)
@@ -337,6 +337,8 @@ static int tonga_smu_fini(struct pp_smumgr *smumgr)
                kfree(smumgr->backend);
                smumgr->backend = NULL;
        }
+
+       cgs_rel_firmware(smumgr->device, CGS_UCODE_ID_SMU);
        return 0;
 }