summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmily Deng <Emily.Deng@amd.com>2019-11-05 18:20:07 +0800
committerEmily Deng <Emily.Deng@amd.com>2019-11-05 18:20:07 +0800
commit3f36c633f77ab50171fa94e123e46b16ddf45bd8 (patch)
tree07d673cd0646acfd2e2f87cdc7eefcef3ed2ac66
parent51e90843f7d76cbc8f995ce3b263776596753931 (diff)
drm/amdgpu/discovery: Need to free discovery memory
When unloading driver, need to free discovery memory. Signed-off-by: Emily Deng <Emily.Deng@amd.com> Reviewed-by: Xiaojie Yuan <xiaojie.yuan@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 546f192f01e5..fcef4a5cae83 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1973,9 +1973,6 @@ void amdgpu_ttm_late_init(struct amdgpu_device *adev)
{
/* return the VGA stolen memory (if any) back to VRAM */
amdgpu_bo_free_kernel(&adev->stolen_vga_memory, NULL, NULL);
-
- /* return the IP Discovery TMR memory back to VRAM */
- amdgpu_bo_free_kernel(&adev->discovery_memory, NULL, NULL);
}
/**
@@ -1987,7 +1984,10 @@ void amdgpu_ttm_fini(struct amdgpu_device *adev)
return;
amdgpu_ttm_debugfs_fini(adev);
+ /* return the IP Discovery TMR memory back to VRAM */
+ amdgpu_bo_free_kernel(&adev->discovery_memory, NULL, NULL);
amdgpu_ttm_fw_reserve_vram_fini(adev);
+
if (adev->mman.aper_base_kaddr)
iounmap(adev->mman.aper_base_kaddr);
adev->mman.aper_base_kaddr = NULL;