summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
diff options
context:
space:
mode:
authorLikun Gao2018-12-17 13:59:42 +0100
committerAlex Deucher2019-03-19 21:03:56 +0100
commitafba8282292940378632c61e1686f230fa5be655 (patch)
tree58fe0c9b2ffc717d646bf73a1d5068e0f9df426a /drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
parentdrm/amd/powerplay: add function to check pptable for smu11 (diff)
downloadkernel-qcow2-linux-afba8282292940378632c61e1686f230fa5be655.tar.gz
kernel-qcow2-linux-afba8282292940378632c61e1686f230fa5be655.tar.xz
kernel-qcow2-linux-afba8282292940378632c61e1686f230fa5be655.zip
drm/amd/powerplay: update hw fini function to relase some memory
Release memory of table_context->driver_pptable and table_context->ppt_information when smu hw fini. Signed-off-by: Likun Gao <Likun.Gao@amd.com> Reviewed-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Kevin Wang <Kevin1.Wang@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/amdgpu_smu.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/amdgpu_smu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
index c85316617951..e4da464655f8 100644
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
@@ -434,11 +434,16 @@ static int smu_hw_fini(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct smu_context *smu = &adev->smu;
+ struct smu_table_context *table_context = &smu->smu_table;
int ret = 0;
if (adev->asic_type < CHIP_VEGA20)
return -EINVAL;
+ if (!table_context->driver_pptable)
+ return -EINVAL;
+ kfree(table_context->driver_pptable);
+
ret = smu_fini_fb_allocations(smu);
if (ret)
return ret;