Skip to content

Commit bdb7218

Browse files
lema1-devalexdeucher
authored andcommitted
drm/amdgpu: finalizing mem_partitions at the end of GMC v9 sw_fini
The valid num_mem_partitions is required during ttm pool fini, thus move the cleanup at the end of the function. Signed-off-by: Le Ma <le.ma@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 0288603 commit bdb7218

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,8 +2170,6 @@ static int gmc_v9_0_sw_fini(void *handle)
21702170

21712171
if (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 3))
21722172
amdgpu_gmc_sysfs_fini(adev);
2173-
adev->gmc.num_mem_partitions = 0;
2174-
kfree(adev->gmc.mem_partitions);
21752173

21762174
amdgpu_gmc_ras_fini(adev);
21772175
amdgpu_gem_force_release(adev);
@@ -2185,6 +2183,9 @@ static int gmc_v9_0_sw_fini(void *handle)
21852183
amdgpu_bo_free_kernel(&adev->gmc.pdb0_bo, NULL, &adev->gmc.ptr_pdb0);
21862184
amdgpu_bo_fini(adev);
21872185

2186+
adev->gmc.num_mem_partitions = 0;
2187+
kfree(adev->gmc.mem_partitions);
2188+
21882189
return 0;
21892190
}
21902191

0 commit comments

Comments
 (0)