mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
drm/amdgpu: destroy mutex when tearing down ttm buffer entity
Pair mutex_init() with mutex_destroy() on the GART window allocation failure path and in amdgpu_ttm_buffer_entity_fini(). This is a no-op without CONFIG_DEBUG_MUTEXES, but it keeps lockdep from seeing a live mutex after the entity is freed or re-initialized. Signed-off-by: Perry Yuan <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 03ac40aeed034a0a0d5824ad26f8fbe1f6463698) Cc: [email protected]
This commit is contained in:
1 parent
b5629f4a08
commit
5b0a459f99
1 file changed
+2
@@ -2081,6 +2081,7 @@ static int amdgpu_ttm_buffer_entity_init(struct amdgpu_gtt_mgr *mgr,
|
||||
r = amdgpu_gtt_mgr_alloc_entries(mgr, &entity->gart_node, num_pages,
|
||||
DRM_MM_INSERT_BEST);
|
||||
if (r) {
|
||||
mutex_destroy(&entity->lock);
|
||||
drm_sched_entity_destroy(&entity->base);
|
||||
return r;
|
||||
}
|
||||
@@ -2098,6 +2099,7 @@ static void amdgpu_ttm_buffer_entity_fini(struct amdgpu_gtt_mgr *mgr,
|
||||
struct amdgpu_ttm_buffer_entity *entity)
|
||||
{
|
||||
amdgpu_gtt_mgr_free_entries(mgr, &entity->gart_node);
|
||||
mutex_destroy(&entity->lock);
|
||||
drm_sched_entity_destroy(&entity->base);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user