[PATCH] drm/amdgpu: Need to free discovery memory
Zhang, Hawking
Hawking.Zhang at amd.com
Fri Nov 1 15:30:45 UTC 2019
Besides, the bo for ip_discovery only need to be created and reserved for Navi10 and onwards, although it shouldn't be a big issue to reserve 64K memory in top vram.
Regards,
Hawking
-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Yuan, Xiaojie
Sent: 2019年11月1日 23:14
To: Deng, Emily <Emily.Deng at amd.com>; amd-gfx at lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: Need to free discovery memory
Hi Emily,
Thanks for catching this.
I think freeing Discovery TMR bo should be put at amdgpu_ttm_fini() instead of amdgpu_ttm_late_init() because unlike VGA stolen bo, touching PSP-protected Discovery TMR bo will cause GPU hang. Therefore, it should be reserved across the life-cycle of amdgpu driver.
Please kindly send v2 patch with this change.
BR,
Xiaojie
________________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Emily Deng <Emily.Deng at amd.com>
Sent: Friday, November 1, 2019 5:07 PM
To: amd-gfx at lists.freedesktop.org
Cc: Deng, Emily
Subject: [PATCH] drm/amdgpu: Need to free discovery memory
When unloading driver, need to free discovery memory.
Signed-off-by: Emily Deng <Emily.Deng at amd.com>
---
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
index 9f2a893..50d6ed2 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
@@ -1091,8 +1091,11 @@ static int gmc_v9_0_sw_fini(void *handle)
amdgpu_gem_force_release(adev);
amdgpu_vm_manager_fini(adev);
- if (gmc_v9_0_keep_stolen_memory(adev))
+ if (gmc_v9_0_keep_stolen_memory(adev)) {
amdgpu_bo_free_kernel(&adev->stolen_vga_memory, NULL, &stolen_vga_buf);
+ /* return the IP Discovery TMR memory back to VRAM */
+ amdgpu_bo_free_kernel(&adev->discovery_memory, NULL, NULL);
+ }
amdgpu_gart_table_vram_free(adev);
amdgpu_bo_fini(adev);
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list