Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afba8282 authored by Likun Gao's avatar Likun Gao Committed by Alex Deucher
Browse files

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: default avatarLikun Gao <Likun.Gao@amd.com>
Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
Reviewed-by: default avatarKevin Wang <Kevin1.Wang@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c6eef2d0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;