Skip to contentSkip to conversation

drm/amdgpu: Fix some unload driver issues

PATCH In review Emily Deng 2 participants 2 messages Mar 5, 2021

Subsystems (2)
lore
Share & tools
lore

Emily Deng

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix some unload driver issues

If have memory leak, maybe it will have issue in
ttm_bo_force_list_clean-> ttm_mem_evict_first.

Set adev->gart.ptr to null to avoid to call amdgpu_gmc_set_pte_pde to cause ptr issue pointer when calling amdgpu_gart_unbind in amdgpu_bo_fini which is after gart_fini.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +1 -0
index 23823a57374f..f1ede4b43d07 100644
@@ -202,6 +202,7 @@ void amdgpu_gart_table_vram_free(struct amdgpu_device *adev)
 		return;
 	}
 	amdgpu_bo_unref(&adev->gart.bo);
+	adev->gart.ptr = NULL;
 }
 
 /*
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw

Am 05.03.21 um 10:04 schrieb Emily Deng:

Quoted 8 lines

If have memory leak, maybe it will have issue in
ttm_bo_force_list_clean-> ttm_mem_evict_first.

Set adev->gart.ptr to null to avoid to call amdgpu_gmc_set_pte_pde to cause ptr issue pointer when calling amdgpu_gart_unbind in amdgpu_bo_fini which is after gart_fini.

Quoted 9 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +0 -0
index 23823a57374f..f1ede4b43d07 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c void amdgpu_gart_table_vram_free(struct amdgpu_device *adev) · line 208

Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +1 -0
@@ -202,6 +202,7 @@ void amdgpu_gart_table_vram_free(struct amdgpu_device *adev)
  		return;
  	}
  	amdgpu_bo_unref(&adev->gart.bo);
+	adev->gart.ptr = NULL;
  }
 
  /*

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx